Example #1
0
 public function action()
 {
     $accessToken = $this->getRequest('accessToken', '');
     $openId = $this->getRequest('openId', '');
     if ($accessToken == "" || $openId == "") {
         $this->showErrorJson();
     }
     $SsoObj = new Sso();
     $isfirst = $SsoObj->checkQqLoginFirst($openId);
     if ($isfirst === true) {
         $errorInfo = ErrorConf::qqAuthInfoEmpty();
         $this->showErrorJson($errorInfo);
     } else {
         $userinfo = $SsoObj->qqlogin($accessToken, $openId);
     }
     $this->showSuccJson($userinfo);
 }
Example #2
0
 public function action()
 {
     $accessToken = $this->getRequest('accessToken', '');
     $openId = $this->getRequest('openId', '');
     $nickName = trim($this->getRequest('nickName', ''));
     if ($accessToken == "" || $openId == "" || $nickName == "") {
         $this->showErrorJson();
     }
     $SsoObj = new Sso();
     $isfirst = $SsoObj->checkQqLoginFirst($openId);
     if ($isfirst === true) {
         $qc = new QC($accessToken, $openId);
         $userinfo = $SsoObj->initQqLoginUser($qc, $accessToken, $openId, $nickName);
         if (empty($userinfo)) {
             $this->showErrorJson($SsoObj->getError());
         }
     } else {
         $userinfo = $SsoObj->qqlogin($accessToken, $openId);
     }
     $this->showSuccJson($userinfo);
 }
Example #3
0
 function action()
 {
     $SsoObj = new Sso();
     $SsoObj->logout();
     $this->showSuccJson();
 }
Example #4
0
 protected function getUid()
 {
     $SsoObj = new Sso();
     $uid = $SsoObj->getUid();
     return $uid;
 }