作者 chencheng

0529-test-4

... ... @@ -50,7 +50,10 @@ class Wechat extends Api
$REDIRECT_URI = 'https://coupon.xp.yn.cn/index.php/api/v1/Wechat/test_code';
$SCOPE = 'snsapi_base';
$redirect = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$APPID&redirect_uri=$REDIRECT_URI&response_type=code&scope=$SCOPE&state=STATE#wechat_redirect";
header("Location:".$redirect);
$curUrl = request()->url(true);
$response = $app->oauth->scopes(['snsapi_userinfo']) ->redirect($curUrl);
}else{
//解析code
$app = WehcatModule::getInstance()->initWechat();
... ...