コード例 #1
0
 /**
  *用户登陆
  * @return [type] [description]
  */
 public function loginAction()
 {
     $type = $this->_sanReq['type'] ? $this->_sanReq['type'] : '';
     if (isset($this->_sanReq['deviceToken'])) {
         $deviceToken = $this->_sanReq['deviceToken'];
     } else {
         $deviceToken = '';
     }
     $loginRes = $this->user->login($this->_sanReq['mobi'], $this->_sanReq['pass'], $this->_sanReq['type'], $deviceToken, $type);
     if (is_array($loginRes)) {
         if ($deviceToken) {
             $DevTagsObj = new DevTags();
             //记录deviceToken
             $divecesTokenInfo = $DevTagsObj->saveDeviceToken($loginRes['u_id'], $deviceToken, $type, isset($this->_sanReq['cver']) ? $this->_sanReq['cver'] : '');
             if (is_array($divecesTokenInfo)) {
                 $loginRes['disturb'] = $divecesTokenInfo['disturbMode'];
             }
         } else {
             $loginRes['disturb'] = '1';
         }
         $this->_returnResult($loginRes);
     } else {
         $this->_showMsg($loginRes, $this->di['flagmsg'][$loginRes]);
     }
 }
コード例 #2
0
 /**
  * 第三方登录
  */
 public function loginAction()
 {
     $deviceToken = $this->_sanReq['deviceToken'] ? $this->_sanReq['deviceToken'] : '';
     $res = $this->oauth->thirdLogin($this->_sanReq['u_tags'], $this->_sanReq['access_token'], $deviceToken, $this->_sanReq['type']);
     if (is_array($res)) {
         if ($deviceToken) {
             $DevTagsObj = new DevTags();
             //记录deviceToken
             $divecesTokenInfo = $DevTagsObj->saveDeviceToken($res['u_id'], $deviceToken, $this->_sanReq['type'], isset($this->_sanReq['cver']) ? $this->_sanReq['cver'] : '');
             if (is_array($divecesTokenInfo)) {
                 $res['disturb'] = $divecesTokenInfo['disturbMode'];
             } else {
                 $res['disturb'] = '1';
             }
         }
         $this->_returnResult($res);
     } else {
         $this->_showMsg($res, $this->di['flagmsg'][$res]);
     }
 }