From 34487865f3065278a5c419f5c6c05538b6fd6cec Mon Sep 17 00:00:00 2001 From: YangHuang Date: Wed, 9 Mar 2022 00:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=99=BB=E5=BD=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=8A=B6=E6=80=81=E5=80=BC=E6=94=B9=E4=B8=BA=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/auth/service/SysLoginService.java | 4 ++-- .../java/com/ruoyi/common/core/constant/Constants.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java index ddd6bfb5b..489399397 100644 --- a/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java +++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java @@ -148,11 +148,11 @@ public class SysLoginService // 日志状态 if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) { - logininfor.setStatus("0"); + logininfor.setStatus(Constants.LOGIN_SUCCESS_STATUS); } else if (Constants.LOGIN_FAIL.equals(status)) { - logininfor.setStatus("1"); + logininfor.setStatus(Constants.LOGIN_FAIL_STATUS); } remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER); } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java index fd7632190..d31d1b843 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java @@ -52,6 +52,16 @@ public class Constants */ public static final Integer FAIL = 500; + /** + * 登录成功状态 + */ + public static final String LOGIN_SUCCESS_STATUS = "1"; + + /** + * 登录失败状态 + */ + public static final String LOGIN_FAIL_STATUS = "0"; + /** * 登录成功 */