完善登出功能,记录日志

This commit is contained in:
asas6559 2021-03-08 22:34:39 +08:00
parent d5ac6e7a19
commit 4294ed2548

View File

@ -162,7 +162,9 @@ public class SysAuthServiceImpl implements SysAuthService {
public void logout(String token) { public void logout(String token) {
// 查询用户信息 // 查询用户信息
LoginUser loginUser = userSessionService.getLoginUser(token); LoginUser loginUser = userSessionService.getLoginUser(token);
if(loginUser == null) return; if(loginUser == null) {
return;
}
// 删除session // 删除session
userSessionService.deleteUserSession(token); userSessionService.deleteUserSession(token);
this.createLogoutLog(loginUser.getUsername(), SysLoginResultEnum.SUCCESS); this.createLogoutLog(loginUser.getUsername(), SysLoginResultEnum.SUCCESS);