master
cody 11 months ago
parent 3c34de74bf
commit 78810188ef

@ -42,7 +42,6 @@ class UserController extends CommonController
$appSecret = \config('app.wechat_appsecret');
$url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $appSecret . "&js_code={$all['code']}&grant_type=authorization_code";
$userInfo = json_decode(file_get_contents($url), true);
dd($url,$userInfo);
if (!isset($userInfo['openid'])) {
return $this->fail([ResponseCode::ERROR_BUSINESS, __('mobile.user.code_invalid')]);
}

Loading…
Cancel
Save