Browse Source

Merge branch 'liuzj-1001016-dev' into test

liuzejian 1 year ago
parent
commit
fcfc1aeb8f
1 changed files with 6 additions and 3 deletions
  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();
     }