正在显示
1 个修改的文件
包含
11 行增加
和
1 行删除
@@ -416,7 +416,17 @@ class LoginController extends HomeBaseController | @@ -416,7 +416,17 @@ class LoginController extends HomeBaseController | ||
416 | $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$this->appkey2.'&secret='.$this->appsecret2; | 416 | $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$this->appkey2.'&secret='.$this->appsecret2; |
417 | $res = $this->http_get($url); | 417 | $res = $this->http_get($url); |
418 | $json_arr = json_decode($res,true); | 418 | $json_arr = json_decode($res,true); |
419 | - var_dump($json_arr);exit; | 419 | + if(!isset($json_arr['access_token'])&&empty($json_arr['access_token'])){ |
420 | + //用户取消登录 | ||
421 | + $this->redirect('/portal/login/thirdLogin'); | ||
422 | + } | ||
423 | + $token = $json_arr['access_token']; | ||
424 | + $openid = 'oYOYl5hbULoKimG5R8Uk-Paha0d8'; | ||
425 | + //通过access_token获取用户信息 | ||
426 | + $url1 = 'https://api.weixin.qq.com/cgi-bin/user/info?access_token='.$token.'&openid='.$openid.'&lang=zh_CN'; | ||
427 | + $res1 = $this->http_get($url1); | ||
428 | + $info = json_decode($res1,true); | ||
429 | + var_dump($info);exit; | ||
420 | } | 430 | } |
421 | 431 | ||
422 | //第三方微博登录 | 432 | //第三方微博登录 |
-
请 注册 或 登录 后发表评论