mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改微信web授权异常处理
This commit is contained in:
parent
3bbfe22b9b
commit
da499ff485
@ -88,19 +88,21 @@ class WechatService
|
|||||||
* 获取微信网页JSSDK
|
* 获取微信网页JSSDK
|
||||||
* @param null|string $url JS签名地址
|
* @param null|string $url JS签名地址
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exception
|
|
||||||
* @throws \WeChat\Exceptions\InvalidResponseException
|
* @throws \WeChat\Exceptions\InvalidResponseException
|
||||||
* @throws \WeChat\Exceptions\LocalCacheException
|
* @throws \WeChat\Exceptions\LocalCacheException
|
||||||
|
* @throws \think\Exception
|
||||||
* @throws \think\exception\PDOException
|
* @throws \think\exception\PDOException
|
||||||
*/
|
*/
|
||||||
public static function webJsSDK($url = null)
|
public static function webJsSDK($url = null)
|
||||||
{
|
{
|
||||||
|
$signUrl = is_null($url) ? app('request')->url(true) : $url;
|
||||||
switch (strtolower(sysconf('wechat_type'))) {
|
switch (strtolower(sysconf('wechat_type'))) {
|
||||||
case 'api':
|
case 'api':
|
||||||
return WechatService::script()->getJsSign(is_null($url) ? app('request')->url(true) : $url);
|
return WechatService::script()->getJsSign($signUrl);
|
||||||
case 'thr':
|
case 'thr':
|
||||||
|
return WechatService::wechat()->jsSign($signUrl);
|
||||||
default:
|
default:
|
||||||
return WechatService::wechat()->jsSign(is_null($url) ? app('request')->url(true) : $url);
|
throw new Exception('请在后面配置微信对接授权模式!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user