/** * 开放帐号登录:通过第三方开放平台认证通过后,获得的帐号id在本地查找是否存在,如果存在登录成功。 * 如果没绑定第三方账号,那么结果不返回securityKey,而是返回第三方账号用户信息;否则返回securityKey以及论坛账号信息。 * @access public * @return string sessionid * @example <pre> os可以是android或者ios <br> post: access_token&platformname(qq|weibo|weixin|taobao)&native_name(回调地址) </pre> */ public function openAccountLoginAction() { $accountData = $this->authThirdPlatform(); // $accountRelationData = $this->_getUserOpenAccountDs()->getUid($accountData['uid'], $accountData['type']); //还没有绑定帐号 if (empty($accountRelationData)) { $accountData['uid'] = 0; //qq not uid $userdata = array('userinfo' => $accountData, 'laiwangSetting' => array_merge(array('laiwangOK' => false), PwLaiWangSerivce::$wk_setting)); } else { /* [验证用户名和密码是否正确] */ $login = new PwLoginService(); $this->runHook('c_login_dorun', $login); Wind::import('SRV:user.srv.PwRegisterService'); $registerService = new PwRegisterService(); $info = $registerService->sysUser($accountRelationData['uid']); if (!$info) { $this->showError('USER:user.syn.error'); } $this->uid = $info['uid']; $_userInfo = $this->_getUserAllInfo(PwUser::FETCH_MAIN + PwUser::FETCH_INFO); $laiwangOK = PwLaiWangSerivce::registerUser($this->uid, $_userInfo['password'], $_userInfo['username'], Pw::getAvatar($this->uid, 'big'), $_userInfo['gender']); PwLaiWangSerivce::updateSecret($this->uid, $_userInfo['password']); PwLaiWangSerivce::updateProfile($this->uid, $_userInfo['username'], Pw::getAvatar($this->uid, 'big'), $_userInfo['gender']); $userdata = $this->_getUserInfo($laiwangOK); } //success $this->setOutput($userdata, 'data'); $this->showMessage('USER:login.success'); }