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); }
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); }
function action() { $SsoObj = new Sso(); $SsoObj->logout(); $this->showSuccJson(); }
protected function getUid() { $SsoObj = new Sso(); $uid = $SsoObj->getUid(); return $uid; }