| | |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_TOO_MANY_FAILS); |
| | | } |
| | | |
| | | //超级管理员配置文件配置账号密码,实现登录, 默认租户id为000000 |
| | | if(tenantId.equals(this.tenantId)){ |
| | | //超级管理员配置文件配置账号密码,实现登录, 默认租户id和超管为配置出来的 |
| | | if(tenantId.equals(this.tenantId) && userName.equals(username)){ |
| | | if (!this.userName.equals(username) && !password.equalsIgnoreCase(this.password)) { |
| | | setFailCount(tenantId, username, count,strategy.getLockingTime()); |
| | | throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); |
| | | } |
| | | //如果ip比对后get抛出异常No value present就直接抛异常结束登录 |
| | | if(ipEnable){ |
| | | Log.debug("当前访问IP:"+getIpAddress(request)); |
| | | // Log.debug("当前访问IP:"+getIpAddress(request)); |
| | | Log.debug("当前访问IP:"+WebUtil.getIP(request)); |
| | | try { |
| | | ips.stream().filter(s -> s.equals(getIpAddress(request))).findFirst().get(); |
| | | ips.stream().filter(s -> s.equals(WebUtil.getIP(request))).findFirst().get(); |
| | | } catch (Exception e){ |
| | | throw new UserDeniedAuthorizationException(TokenUtil.IP_NOT_FOND); |
| | | } |