|
@@ -69,10 +69,10 @@ public class PasswordTokenGranter implements ITokenGranter {
|
|
|
|
|
|
|
|
// 判断登录是否锁定
|
|
// 判断登录是否锁定
|
|
|
// TODO 2.8.3版本将增加:1.参数管理读取配置 2.用户管理增加解封按钮
|
|
// TODO 2.8.3版本将增加:1.参数管理读取配置 2.用户管理增加解封按钮
|
|
|
- int cnt = Func.toInt(bladeRedis.get(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username)), 0);
|
|
|
|
|
- if (cnt >= FAIL_COUNT) {
|
|
|
|
|
- throw new ServiceException(TokenUtil.USER_HAS_TOO_MANY_FAILS);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// int cnt = Func.toInt(bladeRedis.get(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username)), 0);
|
|
|
|
|
+// if (cnt >= FAIL_COUNT) {
|
|
|
|
|
+// throw new ServiceException(TokenUtil.USER_HAS_TOO_MANY_FAILS);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
UserInfo userInfo = null;
|
|
UserInfo userInfo = null;
|
|
|
if (Func.isNoneBlank(username, password)) {
|
|
if (Func.isNoneBlank(username, password)) {
|
|
@@ -93,9 +93,9 @@ public class PasswordTokenGranter implements ITokenGranter {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 错误次数锁定
|
|
// 错误次数锁定
|
|
|
- if (userInfo == null || userInfo.getUser() == null) {
|
|
|
|
|
- bladeRedis.setEx(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username), cnt + 1, Duration.ofMinutes(30));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (userInfo == null || userInfo.getUser() == null) {
|
|
|
|
|
+// bladeRedis.setEx(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username), cnt + 1, Duration.ofMinutes(30));
|
|
|
|
|
+// }
|
|
|
// 多部门情况下指定单部门
|
|
// 多部门情况下指定单部门
|
|
|
if (Func.isNotEmpty(headerDept) && userInfo != null && userInfo.getUser().getDeptId().contains(headerDept)) {
|
|
if (Func.isNotEmpty(headerDept) && userInfo != null && userInfo.getUser().getDeptId().contains(headerDept)) {
|
|
|
userInfo.getUser().setDeptId(headerDept);
|
|
userInfo.getUser().setDeptId(headerDept);
|