From 06e4e5597f4fc8b2113156ba8e4b5d3f4634b426 Mon Sep 17 00:00:00 2001 From: dww Date: Sat, 31 Jan 2026 09:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bicloud/service/impl/UserServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/bicloud/service/impl/UserServiceImpl.java b/src/main/java/com/bicloud/service/impl/UserServiceImpl.java index 511c88e..ddf5dbc 100644 --- a/src/main/java/com/bicloud/service/impl/UserServiceImpl.java +++ b/src/main/java/com/bicloud/service/impl/UserServiceImpl.java @@ -44,15 +44,15 @@ public class UserServiceImpl implements UserService { return Result.error("获取验证码次数过多,您的手机号已被限制!"); } - String blacklistIpAddrCount = stringRedisTemplate.opsForValue().get(GET_CODE_BLACKLIST_IP_ADDR + clientIpAddr); - int getCodeIpAddrCount = (blacklistIpAddrCount != null) ? Integer.parseInt(blacklistIpAddrCount) : 0; - if (getCodeIpAddrCount >= 300) { - return Result.error("获取验证码次数过多,您的IP已被限制!"); - } +// String blacklistIpAddrCount = stringRedisTemplate.opsForValue().get(GET_CODE_BLACKLIST_IP_ADDR + clientIpAddr); +// int getCodeIpAddrCount = (blacklistIpAddrCount != null) ? Integer.parseInt(blacklistIpAddrCount) : 0; +// if (getCodeIpAddrCount >= 300) { +// return Result.error("获取验证码次数过多,您的IP已被限制!"); +// } // 6.更新锁和黑名单 stringRedisTemplate.opsForValue().set(GET_CODE_BLACKLIST_PHONE + phone, String.valueOf(getCodePhoneCount + 1), REFRESH_BLACKLIST_TTL, TimeUnit.HOURS); - stringRedisTemplate.opsForValue().set(GET_CODE_BLACKLIST_IP_ADDR + clientIpAddr, String.valueOf(getCodeIpAddrCount + 1), REFRESH_BLACKLIST_TTL, TimeUnit.HOURS); +// stringRedisTemplate.opsForValue().set(GET_CODE_BLACKLIST_IP_ADDR + clientIpAddr, String.valueOf(getCodeIpAddrCount + 1), REFRESH_BLACKLIST_TTL, TimeUnit.HOURS); stringRedisTemplate.opsForValue().set(GET_CODE_LOCK + phone, "1", GET_CODE_LOCK_TTL, TimeUnit.MINUTES); // 7.校验通过,生成验证码