Przeglądaj źródła

记录登录信息状态值改为常量

YangHuang 4 lat temu
rodzic
commit
34487865f3

+ 2 - 2
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java

@@ -148,11 +148,11 @@ public class SysLoginService
148
         // 日志状态
148
         // 日志状态
149
         if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
149
         if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
150
         {
150
         {
151
-            logininfor.setStatus("0");
151
+            logininfor.setStatus(Constants.LOGIN_SUCCESS_STATUS);
152
         }
152
         }
153
         else if (Constants.LOGIN_FAIL.equals(status))
153
         else if (Constants.LOGIN_FAIL.equals(status))
154
         {
154
         {
155
-            logininfor.setStatus("1");
155
+            logininfor.setStatus(Constants.LOGIN_FAIL_STATUS);
156
         }
156
         }
157
         remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
157
         remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
158
     }
158
     }

+ 10 - 0
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java

@@ -53,6 +53,16 @@ public class Constants
53
     public static final Integer FAIL = 500;
53
     public static final Integer FAIL = 500;
54
 
54
 
55
     /**
55
     /**
56
+     * 登录成功状态
57
+     */
58
+    public static final String LOGIN_SUCCESS_STATUS = "1";
59
+
60
+    /**
61
+     * 登录失败状态
62
+     */
63
+    public static final String LOGIN_FAIL_STATUS = "0";
64
+
65
+    /**
56
      * 登录成功
66
      * 登录成功
57
      */
67
      */
58
     public static final String LOGIN_SUCCESS = "Success";
68
     public static final String LOGIN_SUCCESS = "Success";