find(); // $userTokenCache->deleteUserInfo($userSession->token); $params = (new LoginAccountValidate())->post()->goCheck(); $result = StoreLoginLogic::login($params); if (false === $result) { return $this->fail(StoreLoginLogic::getError()); } return $this->data($result); } /** * @notes 重置密码 * @return \think\response\Json * @author 胥聪 * @date 2025/12/16 14:30 */ public function resetPassword() { $params = (new PasswordValidate())->post()->goCheck('resetPassword'); $result = StoreUserLogic::resetPassword($params); if (true === $result) { return $this->success('操作成功', [], 1, 1); } return $this->fail(StoreUserLogic::getError()); } /** * @notes 退出登录 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/9/16 10:42 */ public function logout() { StoreLoginLogic::logout($this->userInfo); return $this->success(); } /** * @notes 获取微信请求code的链接 * @return \think\response\Json * @author 段誉 * @date 2022/9/15 18:27 */ public function codeUrl() { $url = $this->request->get('url'); $result = ['url' => LoginLogic::codeUrl($url)]; return $this->success('获取成功', $result); } /** * @notes 小程序绑定微信 * @return \think\response\Json * @author 段誉 * @date 2022/9/20 19:48 */ public function mnpAuthBind() { $params = (new WechatLoginValidate())->post()->goCheck("wechatAuth"); $params['user_id'] = $this->userId; $result = LoginLogic::mnpAuthLogin($params); if ($result === false) { return $this->fail(LoginLogic::getError()); } return $this->success('绑定成功', [], 1, 1); } /** * @notes 更新用户头像昵称 * @return \think\response\Json * @author 段誉 * @date 2023/2/22 11:15 */ public function updateUser() { $params = (new WechatLoginValidate())->post()->goCheck("updateUser"); LoginLogic::updateUser($params, $this->userId); return $this->success('操作成功', [], 1, 1); } }