作者 chencheng

0529-test-4

... ... @@ -48,13 +48,14 @@ class Wechat extends Api
$app = WehcatModule::getInstance()->initWechat();
if(empty($code)){
//跳转官方
$APPID = config('site.appid');
$APPID = 'wxb9b259e7a17bda27';
$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";
$curUrl = request()->url(true);
$response = $app->oauth->scopes(['snsapi_userinfo']) ->redirect($curUrl);
return $response;
}else{
//解析code
... ...