From cee220c167d7015f48db21890c1cb96512047bef Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 3 May 2018 11:14:26 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=9C=8D=E5=8A=A1=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/WechatService.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/extend/service/WechatService.php b/extend/service/WechatService.php index ddbca68ac..357ce0e26 100644 --- a/extend/service/WechatService.php +++ b/extend/service/WechatService.php @@ -75,12 +75,13 @@ class WechatService } throw new Exception("Class '{$class}' not found"); case 'thr': - default: list($appid, $appkey) = [sysconf('wechat_thr_appid'), sysconf('wechat_thr_appkey')]; $token = strtolower("{$name}-{$appid}-{$appkey}"); $location = config('wechat.service_url') . "/wechat/api.client/soap/{$token}.html"; $params = ['uri' => strtolower($name), 'location' => $location, 'trace' => true]; return new SoapService(null, $params); + default: + throw new Exception('请在后台配置微信对接授权模式!'); } } @@ -102,7 +103,7 @@ class WechatService case 'thr': return WechatService::wechat()->jsSign($signUrl); default: - throw new Exception('请在后面配置微信对接授权模式!'); + throw new Exception('请在后台配置微信对接授权模式!'); } } @@ -145,7 +146,6 @@ class WechatService redirect(decode(request()->get('rcode')), [], 301)->send(); break; case 'thr': - default: $service = self::wechat(); $result = $service->oauth(session_id(), $url, $fullMode); session("{$appid}_openid", $openid = $result['openid']); @@ -158,6 +158,9 @@ class WechatService redirect($result['url'], [], 301)->send(); } exit("window.location.href='{$result['url']}'"); + default: + throw new Exception('请在后台配置微信对接授权模式!'); + } } @@ -175,7 +178,7 @@ class WechatService case 'thr': return sysconf('wechat_thr_appid'); default: - return ''; + throw new Exception('请在后台配置微信对接授权模式!'); } }