From 012235d05d8dc7c2decdc7229d93033b0399ecbb Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期日, 10 十一月 2024 15:49:53 +0800
Subject: [PATCH] 集成获取mdm分发通用数据格式接口集成
---
Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/service/BladeUserDetailsServiceImpl.java | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/service/BladeUserDetailsServiceImpl.java b/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/service/BladeUserDetailsServiceImpl.java
index eb886d5..ab06f3a 100644
--- a/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/service/BladeUserDetailsServiceImpl.java
+++ b/Source/UBCS/ubcs-auth/src/main/java/com/vci/ubcs/auth/service/BladeUserDetailsServiceImpl.java
@@ -34,7 +34,6 @@
import org.springblade.core.launch.constant.TokenConstant;
import org.springblade.core.log.annotation.LoginOrLogoutLog;
import org.springblade.core.redis.cache.BladeRedis;
-import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.*;
@@ -43,7 +42,6 @@
import com.vci.ubcs.system.entity.Tenant;
import com.vci.ubcs.system.feign.ISysClient;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
@@ -133,9 +131,9 @@
int count = getFailCount(tenantId, username);
//涓洪槻姝㈠彇鍊间负绌烘姤閿欑殑鎯呭喌锛屽綋涓虹┖鐨勬椂鍊欑粰榛樿鍙负5娆′究閿佸畾鐢ㄦ埛鐧诲綍锛屼絾鏄竴鑸緢闅惧嚭鐜拌繖绉嶆儏鍐碉紝鍥犱负鎴慺eign閲岄潰鏄粰浜嗛粯璁ゅ瘑鐮佺瓥鐣ユ煡璇㈢殑
int failCountValue = Func.isEmpty(strategy) ? FAIL_COUNT:Func.toInt(strategy.getLockingNum());
- int failCount = Func.toInt(ParamCache.getValue(FAIL_COUNT_VALUE), failCountValue);
+ //int failCount = Func.toInt(ParamCache.getValue(FAIL_COUNT_VALUE), failCountValue);
- if (count >= failCount) {
+ if (count >= failCountValue) {
throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_TOO_MANY_FAILS);
}
@@ -145,7 +143,7 @@
&& (!this.userName.equals(username) || !BladePasswordEncoderFactories.createDelegatingPasswordEncoder().encode(password).equalsIgnoreCase(AuthConstant.ENCRYPT+this.password))
) {
setFailCount(tenantId, username, count,strategy.getLockingTime());
- throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"杩樻湁銆�"+(failCount-count)+"銆戞灏濊瘯鏈轰細!");
+ throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"杩樻湁銆�"+(failCountValue-count)+"銆戞灏濊瘯鏈轰細!");
}
//濡傛灉ip姣斿鍚巊et鎶涘嚭寮傚父No value present灏辩洿鎺ユ姏寮傚父缁撴潫鐧诲綍
if(ipEnable){
@@ -201,7 +199,7 @@
// 鐢ㄦ埛涓嶅瓨鍦�,浣嗘彁绀虹敤鎴峰悕涓庡瘑鐮侀敊璇苟閿佸畾璐﹀彿
if (user == null || user.getId() == null) {
setFailCount(tenantId, username, count,strategy.getLockingTime());
- throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"杩樻湁銆�"+(failCount-count)+"銆戞灏濊瘯鏈轰細!");
+ throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"杩樻湁銆�"+(failCountValue-count)+"銆戞灏濊瘯鏈轰細!");
}
// 鐢ㄦ埛鐘舵�佷负1鏃惰鏄庤鐢ㄦ埛琚攣瀹�
if(user.getUserStatus() == 1){
@@ -211,7 +209,7 @@
// 鐢ㄦ埛瀛樺湪浣嗗瘑鐮侀敊璇�,瓒呰繃娆℃暟鍒欓攣瀹氳处鍙�
if (grantType != null && !grantType.equals(TokenUtil.REFRESH_TOKEN_KEY) && !user.getPassword().equals(hex)) {
setFailCount(tenantId, username, count,strategy.getLockingTime());
- throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"杩樻湁銆�"+(failCount-count)+"銆戞灏濊瘯鏈轰細!");
+ throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND+"杩樻湁銆�"+(failCountValue-count)+"銆戞灏濊瘯鏈轰細!");
}
// 鐢ㄦ埛瑙掕壊涓嶅瓨鍦�
if (Func.isEmpty(userInfo.getRoles())) {
--
Gitblit v1.9.3