feat: 支持邮箱登录
This commit is contained in:
@@ -56,11 +56,11 @@ public class SysLoginService {
|
||||
throw new ServiceException("auth.password.not.in.specified.range");
|
||||
}
|
||||
// 用户名不在指定范围内 错误
|
||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "auth.username.not.in.specified.range");
|
||||
throw new ServiceException("auth.username.not.in.specified.range");
|
||||
}
|
||||
// if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
// || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
// recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "auth.username.not.in.specified.range");
|
||||
// throw new ServiceException("auth.username.not.in.specified.range");
|
||||
// }
|
||||
// IP黑名单校验
|
||||
String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST));
|
||||
if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) {
|
||||
|
||||
@@ -56,11 +56,11 @@ public class ULoginService {
|
||||
throw new ServiceException("auth.password.not.in.specified.range");
|
||||
}
|
||||
// 用户名不在指定范围内 错误
|
||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "auth.username.not.in.specified.range");
|
||||
throw new ServiceException("auth.username.not.in.specified.range");
|
||||
}
|
||||
// if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
// || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
// recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "auth.username.not.in.specified.range");
|
||||
// throw new ServiceException("auth.username.not.in.specified.range");
|
||||
// }
|
||||
// IP黑名单校验
|
||||
String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST));
|
||||
if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) {
|
||||
|
||||
Reference in New Issue
Block a user