|
|
|
|
@ -41,7 +41,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($userInfo);
|
|
|
|
|
if (!isset($userInfo['openid'])) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, 'code异常']);
|
|
|
|
|
}
|
|
|
|
|
|