Merge branch 'master' of http://app.git.1nww.com:8188/gitlab-instance-db4ab2e7/cxhxy
This commit is contained in:
commit
b2db6d7c97
@ -183,10 +183,10 @@ class User extends Controller
|
||||
|
||||
public function wxCode()
|
||||
{
|
||||
$coupon_id = $this->request->get('id');
|
||||
$coupon_id = $this->request->get('coupon_id') ?? '';
|
||||
$appid = 'wx89c12dd426a55a2e';
|
||||
$redirect_uri = 'https://app.cxhxy.dev.1nww.com/#/pages/details/detail?coupon=' . $coupon_id;
|
||||
$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
|
||||
$wx_redirect_uri = 'https://app.cxhxy.dev.1nww.com/api/food.user/wxLogin?coupon_id=' . $coupon_id;
|
||||
$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri={$wx_redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
|
||||
return $this->renderSuccess($url, '成功');
|
||||
}
|
||||
|
||||
@ -198,6 +198,8 @@ class User extends Controller
|
||||
if (empty($get['code'])) {
|
||||
return $this->renderError('授权失败');
|
||||
}
|
||||
$coupon_id = $get['coupon_id'] ?? '';
|
||||
|
||||
$appid = 'wx89c12dd426a55a2e';
|
||||
$app_secret = '33e66bcf944f9810abbb5ddd7825403d';
|
||||
$url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=$appid&secret=$app_secret&code={$get['code']}&grant_type=authorization_code";
|
||||
@ -214,8 +216,7 @@ class User extends Controller
|
||||
'openid' => $openid,
|
||||
'redirect_uri' => 'https://app.cxhxy.dev.1nww.com/#/pages/details/details'
|
||||
];
|
||||
|
||||
return redirect(urlencode('https://app.cxhxy.dev.1nww.com/#/pages/details/details?openid=' . $openid));
|
||||
return redirect(urlencode('https://app.cxhxy.dev.1nww.com/#/pages/details/details?openid=' . $openid . '&coupon_id=' . $coupon_id));
|
||||
}
|
||||
}
|
||||
return $this->renderError('授权失败');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user