Bläddra i källkod

Merge branch 'liuzj-1001016-dev' into test

liuzejian 1 år sedan
förälder
incheckning
fcfc1aeb8f
1 ändrade filer med 6 tillägg och 3 borttagningar
  1. 6 3
      modules/Channel/Http/Controllers/WechatOpenPlatformController.php

+ 6 - 3
modules/Channel/Http/Controllers/WechatOpenPlatformController.php

@@ -4,6 +4,7 @@ namespace Modules\Channel\Http\Controllers;
 
 use Catch\Base\CatchController;
 use EasyWeChat\OpenPlatform\Application;
+use EasyWeChat\OpenPlatform\Server\Guard;
 use Illuminate\Foundation\Validation\ValidatesRequests;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Cache;
@@ -107,10 +108,12 @@ class WechatOpenPlatformController extends CatchController
 
         $server = $app->server;
 
-        $server->handleUnauthorized(function($message, \Closure $next) {
+        $server->push(function ($message) {
+            myLog('authorCommand')->info('取消授权', [
+                'message' => $message,
+            ]);
             WechatOpenPlatformService::handleUnauthorized($message);
-            return $next($message);
-        });
+        }, Guard::EVENT_UNAUTHORIZED);
 
         return $server->serve();
     }