From afec25a899da0fdf7fdd23de9109419e36d38e03 Mon Sep 17 00:00:00 2001 From: 21819 Date: Mon, 29 Jan 2024 17:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=80=BB=E8=BE=91=E5=AE=8C?= =?UTF-8?q?=E5=96=84=EF=BC=8C=E6=B3=A8=E9=94=80=E5=8A=9F=E8=83=BD=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/biutag/outeradmin/controller/LoginController.java | 7 +++++++ 1 file changed, 7 insertions(+) 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(); + } }