post(); Vcode::check($D['username'],$D['vcode'],VcodeScene::SIGNUP['value'],$D['token']); try { $UserModel = User::create([ 'mobile' => $D['username'], ]); $user =PluginUser::where('id',$UserModel->id)->find(); if(!$user){ return $this->fail('用户不存在'); } if($user->state == State::NO['value']){ return $this->fail('用户状态异常'); } // 更新登录信息 $ip = $request->getRealIp(); $user->login_ip = $ip; $user->login_time = date('Y-m-d H:i:s'); if ($user->save() === false) { return $this->fail('登录失败'); } $info = PluginUser::getTokenInfo($user); return $this->resData($info); } catch (\Throwable $th) { return $this->exception($th); } } }