Browse Source

登录逻辑完善,注销功能实现

dev_ycq
21819 2 years ago
parent
commit
afec25a899
  1. 7
      mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/LoginController.java

7
mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/LoginController.java

@ -36,6 +36,7 @@ public class LoginController {
if (user == null) { if (user == null) {
return ErrorEnum.LOGIN_ACCOUNT_ERROR.getCode(); return ErrorEnum.LOGIN_ACCOUNT_ERROR.getCode();
} else { } else {
request.getSession().setAttribute("user", user);
return ErrorEnum.SUCCESS.getCode(); return ErrorEnum.SUCCESS.getCode();
} }
} }
@ -56,4 +57,10 @@ public class LoginController {
} }
} }
@RequestMapping("/logout")
public int logout(HttpServletRequest request) {
request.getSession().removeAttribute("user");
return ErrorEnum.SUCCESS.getCode();
}
} }

Loading…
Cancel
Save