diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/LoginController.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/LoginController.java index 22871b9..b71aa5f 100644 --- a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/LoginController.java +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/LoginController.java @@ -36,6 +36,7 @@ public class LoginController { if (user == null) { return ErrorEnum.LOGIN_ACCOUNT_ERROR.getCode(); } else { + request.getSession().setAttribute("user", user); 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(); + } }