From f40bd18d8329320f43fcde54b74bdb1fe3e6560a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=90=E5=B0=8F=E5=BF=83?= Date: Tue, 12 Feb 2019 23:52:07 +0800 Subject: [PATCH] fixed #12 --- src/Middleware/OauthMiddleware.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Middleware/OauthMiddleware.php b/src/Middleware/OauthMiddleware.php index 6852bc1..8995edf 100644 --- a/src/Middleware/OauthMiddleware.php +++ b/src/Middleware/OauthMiddleware.php @@ -37,7 +37,10 @@ public function handle(Request $request, \Closure $next, $param = null) /** @var Application $officialAccount */ $officialAccount = app(\sprintf('wechat.official_account.%s', $account)); if (!$scopes) { - $scopes = config(\sprintf('wechat.official_account.%s.oauth.scopes', $account), ['snsapi_base']); + $scopes = config(\sprintf('wechat.official_account.%s.oauth.scopes', $account)); + } + if (!$scopes){ + $scopes = ['snsapi_base']; } if (is_string($scopes)) { $scopes = array_map('trim', explode(',', $scopes));