| | |
| | | * @param string $third_info 三方用户信息 注:需保持统一结构 |
| | | * @return boolean |
| | | */ |
| | | public function register($username = '', $password, $email = '', $mobile = '', $extend = [],$third_platform="",$third_info=[]) |
| | | public function register($username = '', $password, $email = '', $mobile = '', $extend = [],$third_platform="",$third_info=[],$pushCid="") |
| | | { |
| | | // 检测用户名、昵称、邮箱、手机号是否存在 |
| | | if(!empty($third_platform) && !empty($third_info)){ |
| | |
| | | 'logintime' => $time, |
| | | 'loginip' => $ip, |
| | | 'prevtime' => $time, |
| | | 'status' => 'normal' |
| | | 'status' => 'normal', |
| | | 'push_cid'=>$pushCid |
| | | ]); |
| | | //$params['password'] = $this->getEncryptPassword($password, $params['salt']); |
| | | $params = array_merge($params, $extend); |
| | |
| | | * @param int $user_id |
| | | * @return boolean |
| | | */ |
| | | public function direct($user_id) |
| | | public function direct($user_id,$pushCid='') |
| | | { |
| | | $user = User::get($user_id); |
| | | if ($user) { |
| | |
| | | //!empty(PUSH_CID) && $user->push_cid = PUSH_CID; |
| | | //重置登录失败次数 |
| | | $user->loginfailure = 0; |
| | | if(!empty($pushCid)) |
| | | { |
| | | $user->push_cid=$pushCid; |
| | | } |
| | | $user->save(); |
| | | $this->_user = $user; |
| | | $this->_token = Random::uuid(); |