From da499ff48570a72f466c6a9101e1b165beeaa078 Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 3 May 2018 11:13:06 +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=A1web=E6=8E=88=E6=9D=83=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/WechatService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extend/service/WechatService.php b/extend/service/WechatService.php index a30f30031..ddbca68ac 100644 --- a/extend/service/WechatService.php +++ b/extend/service/WechatService.php @@ -88,19 +88,21 @@ class WechatService * 获取微信网页JSSDK * @param null|string $url JS签名地址 * @return array - * @throws Exception * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException + * @throws \think\Exception * @throws \think\exception\PDOException */ public static function webJsSDK($url = null) { + $signUrl = is_null($url) ? app('request')->url(true) : $url; switch (strtolower(sysconf('wechat_type'))) { case 'api': - return WechatService::script()->getJsSign(is_null($url) ? app('request')->url(true) : $url); + return WechatService::script()->getJsSign($signUrl); case 'thr': + return WechatService::wechat()->jsSign($signUrl); default: - return WechatService::wechat()->jsSign(is_null($url) ? app('request')->url(true) : $url); + throw new Exception('请在后面配置微信对接授权模式!'); } }