Update WechatService.php

This commit is contained in:
Anyon 2019-12-23 15:45:00 +08:00
parent d40ba27fcf
commit dcfc8a6bf0

View File

@ -255,7 +255,7 @@ class WechatService extends Service
/** /**
* 获取微信网页JSSDK * 获取微信网页JSSDK
* @param string $url JS签名地址 * @param string $location JS签名地址
* @return array * @return array
* @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException * @throws \WeChat\Exceptions\LocalCacheException
@ -264,13 +264,13 @@ class WechatService extends Service
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
*/ */
public function getWebJssdkSign($url = null) public function getWebJssdkSign($location = null)
{ {
$url = is_null($url) ? $this->app->request->url(true) : $url; $location = is_null($location) ? $this->app->request->url(true) : $location;
if ($this->getType() === 'api') { if ($this->getType() === 'api') {
return self::WeChatScript()->getJsSign($url); return self::WeChatScript()->getJsSign($location);
} else { } else {
return self::ThinkServiceConfig()->jsSign($url); return self::ThinkServiceConfig()->jsSign($location);
} }
} }
} }