登录增加验证码切换

This commit is contained in:
2026-04-06 23:14:19 +08:00
parent 35f9b9c9a6
commit 09abb50a58

View File

@@ -51,11 +51,9 @@ public class UserService {
}
// 校验 IP检查客户端 IP 是否在允许范围内
String allowedIps = user.getAllowedIps();
if (allowedIps != null && !allowedIps.isEmpty()) {
if (!isIpAllowed(clientIp, allowedIps)) {
throw new RuntimeException("登录IP不在允许范围内");
}
}
return jwtUtil.generateToken(username, user.getId());
}