作者 景龙
1 个管道 的构建 通过 耗费 0 秒

调式移动微信登录

@@ -405,12 +405,12 @@ class LoginController extends HomeBaseController @@ -405,12 +405,12 @@ class LoginController extends HomeBaseController
405 405
406 //第三方微信移动端网页登录 406 //第三方微信移动端网页登录
407 public function wx_login_mobile(){ 407 public function wx_login_mobile(){
408 - $code = $this->request->get('code');  
409 - var_dump($code);exit;  
410 - $url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid='.$this->appkey1.'&secret='.$this->appsecret1.'&code='.$code.'&grant_type=authorization_code'; 408 +// $code = $this->request->get('code');
  409 + $code = '021XhRZZ1QOdAS0AqPYZ1IGNZZ1XhRZt';//测试过期code
  410 + $url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid='.$this->appkey3.'&secret='.$this->appsecret3.'&code='.$code.'&grant_type=authorization_code';
411 $res = $this->http_get($url); 411 $res = $this->http_get($url);
412 $json_arr = json_decode($res,true); 412 $json_arr = json_decode($res,true);
413 - 413 + var_dump($json_arr);exit;
414 if(!isset($json_arr['access_token'])&&empty($json_arr['access_token'])){ 414 if(!isset($json_arr['access_token'])&&empty($json_arr['access_token'])){
415 //用户取消登录 415 //用户取消登录
416 $this->redirect('/portal/login/thirdLogin'); 416 $this->redirect('/portal/login/thirdLogin');