v1.1 注册ip限制-同一ip同一天内只能注册max个

This commit is contained in:
2022-10-27 16:25:09 +08:00
parent b8a82f968b
commit 9f1965ec28

View File

@@ -148,7 +148,7 @@ public class AccountManageService {
IpMaxRegisterLimitConfig config = getLimitConfig();
if (null != config && config.getOpen()){
int count = accountService.getRegisterIpCountByOneDay(ipAddress);
if (count > config.getMax()) {
if (count >= config.getMax()) {
throw new CustomOAuth2Exception(CustomOAuth2Exception.SIGN_IP_TO_OFTEN, "注册过于频繁");
}
}
@@ -334,7 +334,7 @@ public class AccountManageService {
IpMaxRegisterLimitConfig config = getLimitConfig();
if (null != config && config.getOpen()){
int count = accountService.getRegisterIpCountByOneDay(ipAddress);
if (count > config.getMax()) {
if (count >= config.getMax()) {
throw new CustomOAuth2Exception(CustomOAuth2Exception.SIGN_IP_TO_OFTEN, "注册过于频繁");
}
}
@@ -793,7 +793,7 @@ public class AccountManageService {
IpMaxRegisterLimitConfig config = getLimitConfig();
if (null != config && config.getOpen()){
int count = accountService.getRegisterIpCountByOneDay(ipAddress);
if (count > config.getMax()) {
if (count >= config.getMax()) {
throw new CustomOAuth2Exception(CustomOAuth2Exception.SIGN_IP_TO_OFTEN, "注册过于频繁");
}
}