1.修改用户登出逻辑
2.添加拦截器动态刷新用户 token 有效期
This commit is contained in:
@@ -30,8 +30,6 @@ import javax.annotation.Resource;
|
||||
public class UserController {
|
||||
|
||||
|
||||
// @Resource
|
||||
// private SystemUsersService usersService;
|
||||
|
||||
@Resource
|
||||
private LoginService loginService;
|
||||
@@ -40,7 +38,6 @@ public class UserController {
|
||||
@PostMapping("doLogin")
|
||||
public BaseResponse<SystemUsersVO> doLogin(@RequestBody SystemUsersDTO usersDTO) {
|
||||
return ResultUtils.success(loginService.login(LoginSceneEnum.HOST, usersDTO));
|
||||
// return ResultUtils.success(systemUsersVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +51,6 @@ public class UserController {
|
||||
@PostMapping("aiChat-doLogin")
|
||||
public BaseResponse<SystemUsersVO> aiChatDoLogin(@RequestBody SystemUsersDTO usersDTO) {
|
||||
return ResultUtils.success(loginService.login(LoginSceneEnum.AI_CHAT, usersDTO));
|
||||
// return ResultUtils.success(systemUsersVO);
|
||||
}
|
||||
|
||||
@PostMapping("aiChat-logout")
|
||||
@@ -62,23 +58,9 @@ public class UserController {
|
||||
return ResultUtils.success(loginService.aiChatLogout(usersDTO));
|
||||
}
|
||||
|
||||
//
|
||||
// private SystemUsers getUserByName(@RequestBody SystemUsersDTO usersDTO) {
|
||||
// SystemUsers user = usersService.getUserByUserName(usersDTO.getUsername(),usersDTO.getTenantId());
|
||||
// if (user == null) {
|
||||
// throw new BusinessException(ErrorCode.USERNAME_OR_PASSWORD_ERROR);
|
||||
// }
|
||||
// if (!usersService.isPasswordMatch(usersDTO.getPassword(), user.getPassword())) {
|
||||
// throw new BusinessException(ErrorCode.USERNAME_OR_PASSWORD_ERROR);
|
||||
// }
|
||||
//
|
||||
// if (CommonStatusEnum.isDisable(Integer.valueOf(user.getStatus()))) {
|
||||
// throw new BusinessException(ErrorCode.USER_DISABLE);
|
||||
// }
|
||||
// if (usersService.isExpired(usersDTO.getTenantId())){
|
||||
// throw new BusinessException(ErrorCode.PACKAGE_EXPIRED);
|
||||
// }
|
||||
// return user;
|
||||
// }
|
||||
@GetMapping("/logout")
|
||||
public BaseResponse<Boolean> logout(){
|
||||
return ResultUtils.success(loginService.logout());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user