|
|
@@ -11,7 +11,7 @@ import com.doc.common.utils.SecurityUtils;
|
|
|
import com.doc.framework.manager.AsyncManager;
|
|
|
import com.doc.framework.manager.factory.AsyncFactory;
|
|
|
import com.doc.framework.security.context.AuthenticationContextHolder;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
+import com.doc.system.service.ISysConfigService;
|
|
|
import org.springframework.security.core.Authentication;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -27,12 +27,9 @@ import java.util.concurrent.TimeUnit;
|
|
|
public class SysPasswordService {
|
|
|
@Resource
|
|
|
private RedisCache redisCache;
|
|
|
+ @Resource
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
|
- @Value(value = "${user.password.maxRetryCount}")
|
|
|
- private int maxRetryCount;
|
|
|
-
|
|
|
- @Value(value = "${user.password.lockTime}")
|
|
|
- private int lockTime;
|
|
|
|
|
|
/**
|
|
|
* 登录账户密码错误次数缓存键名
|
|
|
@@ -45,6 +42,9 @@ public class SysPasswordService {
|
|
|
}
|
|
|
|
|
|
public void validate(SysUser user) {
|
|
|
+ int maxRetryCount = Integer.parseInt(configService.selectConfigByKey("user.password.maxRetryCount"));
|
|
|
+ int lockTime = Integer.parseInt(configService.selectConfigByKey("user.password.lockTime"));
|
|
|
+
|
|
|
Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext();
|
|
|
String username = usernamePasswordAuthenticationToken.getName();
|
|
|
String password = usernamePasswordAuthenticationToken.getCredentials().toString();
|