public function qqcallback(){ require_once ("./plugins/qq/API/qqConnectAPI.php"); $qc=new \QC(); $access_token=$qc->qq_callback(); $openid=$qc->get_openid(); $qc=new \QC($access_token,$openid); $info=$qc->get_user_info(); $user=User::where('open_type','qq')->where('openid',$openid)->find(); if($user){ $user->nickname=$info['nickname']; $user->save(); }else{ User::create(['open_type'=>'qq','openid'=>$openid,'nickname'=>$info['nick']]); } $user=User::where('open_type','qq')->where('openid',$openid)->find(); //dump($user);die(); session('user_info',$user['nickname']); session('info',$user['id']); CartLogic::cookieToDb(); $back_url = session('back_url') ?: 'home/index/index'; $this->redirect($back_url); $this->redirect('home/index/index'); } <a href="/plugins/qq/example/oauth/index.php">//点击事件跳转三方地址 APP ID :101542020 APP Key :539cd4f7784f107fa74ad58d87b5c916 回调地址:http://www.tpshop.com/index.php/home/login/qqcallback
11-11
11-11