|
@@ -3,6 +3,7 @@
|
|
|
namespace Modules\Channel\Services\WechatOpenPlatform;
|
|
|
|
|
|
use EasyWeChat\OpenPlatform\Application;
|
|
|
+use EasyWeChat\OpenPlatform\Message;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Modules\Common\Errors\Errors;
|
|
@@ -58,4 +59,18 @@ class WechatOpenPlatformService
|
|
|
$app->setCache(Cache::store('redis'));
|
|
|
return $app;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取消授权
|
|
|
+ * @param Message $message
|
|
|
+ */
|
|
|
+ public static function handleUnauthorized($message) {
|
|
|
+ $component_appid = $message['AppId'];
|
|
|
+ $authorizer_appid = $message['AuthorizerAppid'];
|
|
|
+ DB::table('wechat_authorization_infos')
|
|
|
+ ->where([
|
|
|
+ 'component_appid' => $component_appid,
|
|
|
+ 'authorizer_appid' => $authorizer_appid,
|
|
|
+ ])->delete();
|
|
|
+ }
|
|
|
}
|