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