From a03a6c98a94510025d4574fbd06b3d70b1d58ba1 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期三, 26 八月 2026 09:08:06 +0800
Subject: [PATCH] 增加管理后台登录频次校验和连续错误登录后限制登录 修改管理后台验证码生成和登录校验

---
 ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java
index 72bde3b..516d612 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/CacheConstants.java
@@ -24,9 +24,24 @@
     public final static int PASSWORD_MAX_RETRY_COUNT = 5;
 
     /**
-     * 密码锁定时间,默认10(分钟)
+     * 密码锁定时间,默认15(分钟)
      */
-    public final static long PASSWORD_LOCK_TIME = 10;
+    public final static long PASSWORD_LOCK_TIME = 15;
+
+    /**
+     * 登录限流缓存前缀
+     */
+    public static final String LOGIN_RATE_LIMIT_KEY = "login_rate_limit:";
+
+    /**
+     * 登录限流窗口,默认60(秒)
+     */
+    public static final long LOGIN_RATE_LIMIT_WINDOW = 60;
+
+    /**
+     * 单个维度在限流窗口内允许的最大登录次数
+     */
+    public static final int LOGIN_RATE_LIMIT_MAX_COUNT = 5;
 
     /**
      * 权限缓存前缀

--
Gitblit v1.7.1