[更新]增加又模式网页授权兼容

This commit is contained in:
Anyon 2018-03-19 15:36:46 +08:00
parent 000c328161
commit dcda1c9bc8

View File

@ -103,8 +103,8 @@ class WechatService
case 'api':
$wechat = self::oauth();
if (request()->get('state') !== $appid) {
$snsapi = empty($fullMode) ? 'snsapi_base' : 'snsapi_userinfo';
$baseUrl = request()->url(true);
$snsapi = empty($fullMode) ? 'snsapi_base' : 'snsapi_userinfo';
$param = (strpos($baseUrl, '?') !== false ? '&' : '?') . 'rcode=' . encode($baseUrl);
$OauthUrl = $wechat->getOauthRedirect($baseUrl . $param, $appid, $snsapi);
redirect($OauthUrl, [], 301)->send();