...
|
...
|
@@ -49,11 +49,11 @@ class Wechat extends Api |
|
|
if(empty($code)){
|
|
|
//跳转官方
|
|
|
$APPID = 'wxb9b259e7a17bda27';
|
|
|
$REDIRECT_URI = 'https://coupon.xp.yn.cn/index.php/api/v1/Wechat/test_code';
|
|
|
$REDIRECT_URI = urlencode('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);
|
|
|
|
|
|
header("Location:".$redirect);
|
|
|
$response = $app->oauth->scopes(['snsapi_userinfo']) ->redirect(urlencode($curUrl));
|
|
|
|
|
|
return $response;
|
...
|
...
|
|