正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
@@ -49,11 +49,11 @@ class Wechat extends Api | @@ -49,11 +49,11 @@ class Wechat extends Api | ||
49 | if(empty($code)){ | 49 | if(empty($code)){ |
50 | //跳转官方 | 50 | //跳转官方 |
51 | $APPID = 'wxb9b259e7a17bda27'; | 51 | $APPID = 'wxb9b259e7a17bda27'; |
52 | - $REDIRECT_URI = 'https://coupon.xp.yn.cn/index.php/api/v1/Wechat/test_code'; | 52 | + $REDIRECT_URI = urlencode('https://coupon.xp.yn.cn/index.php/api/v1/Wechat/test_code'); |
53 | $SCOPE = 'snsapi_base'; | 53 | $SCOPE = 'snsapi_base'; |
54 | $redirect = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$APPID&redirect_uri=$REDIRECT_URI&response_type=code&scope=$SCOPE&state=STATE#wechat_redirect"; | 54 | $redirect = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$APPID&redirect_uri=$REDIRECT_URI&response_type=code&scope=$SCOPE&state=STATE#wechat_redirect"; |
55 | $curUrl = request()->url(true); | 55 | $curUrl = request()->url(true); |
56 | - | 56 | + header("Location:".$redirect); |
57 | $response = $app->oauth->scopes(['snsapi_userinfo']) ->redirect(urlencode($curUrl)); | 57 | $response = $app->oauth->scopes(['snsapi_userinfo']) ->redirect(urlencode($curUrl)); |
58 | 58 | ||
59 | return $response; | 59 | return $response; |
-
请 注册 或 登录 后发表评论