Ver código fonte

Merge branch 'liuzj-1000975-dev' into test

liuzejian 1 ano atrás
pai
commit
31cb649b80

+ 1 - 1
config/cache.php

@@ -15,7 +15,7 @@ return [
     |
     */
 
-    'default' => env('CACHE_DRIVER', 'file'),
+    'default' => env('CACHE_DRIVER', 'redis'),
 
     /*
     |--------------------------------------------------------------------------

+ 1 - 1
config/database.php

@@ -143,7 +143,7 @@ return [
             'username' => env('REDIS_USERNAME'),
             'password' => env('REDIS_PASSWORD'),
             'port' => env('REDIS_PORT', '6379'),
-            'database' => env('REDIS_CACHE_DB', '1'),
+            'database' => env('REDIS_CACHE_DB', '0'),
         ],
         // 普通redis队列
         'queue-redis' => [

+ 2 - 1
modules/Channel/Http/Controllers/WechatOpenPlatformController.php

@@ -6,6 +6,7 @@ use Catch\Base\CatchController;
 use EasyWeChat\OpenPlatform\Application;
 use Illuminate\Foundation\Validation\ValidatesRequests;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Redis;
 use Modules\Channel\Models\WechatAuthorizationInfo;
@@ -65,7 +66,7 @@ class WechatOpenPlatformController extends CatchController
         $componentInfo = WechatOpenPlatformService::getComponentInfoByAppid($component_appid);
         myLog('authorCommand')->info('start:'. $component_appid);
         $app = WechatOpenPlatformService::buildApplication($componentInfo);
-        $app->setCache(new RedisAdapter(Redis::client()));
+        $app->setCache(Cache::store('redis'));
         $server = $app->getServer();
 
         $server->handleVerifyTicketRefreshed(function($message, \Closure $next) {

+ 9 - 0
tests/Channel/Http/Controllers/WechatOpenPlatformControllerTest.php

@@ -17,4 +17,13 @@ class WechatOpenPlatformControllerTest extends UsedTestCase
                 ['name' => '比利时联合银行股份有限公司', 'is_show' => 1, 'code' => 651],
             ], ['name'], ['is_show']);
     }
+    public function testauthorCommand()
+    {
+        $res = $this->withHeaders([
+            'Authorization' => 'Bearer '. $this->token,
+        ])->json('post','http://localhost/api/channel/openPlatform/authorCommand/wxf313b3506bac2647', [
+
+        ]);
+        $res->dump();
+    }
 }