mirror of https://gitee.com/stylefeng/roses
【7.3.2】【auth】更新缓存使用
parent
ac6bab76a2
commit
e2f86878d0
|
@ -54,7 +54,6 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.pojo.sso.SsoLoginCodeRequest;
|
import cn.stylefeng.roses.kernel.auth.api.pojo.sso.SsoLoginCodeRequest;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.pojo.sso.SsoProperties;
|
import cn.stylefeng.roses.kernel.auth.api.pojo.sso.SsoProperties;
|
||||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||||
import cn.stylefeng.roses.kernel.cache.api.tenant.TenantCacheProxyFactory;
|
|
||||||
import cn.stylefeng.roses.kernel.demo.expander.DemoConfigExpander;
|
import cn.stylefeng.roses.kernel.demo.expander.DemoConfigExpander;
|
||||||
import cn.stylefeng.roses.kernel.jwt.JwtTokenOperator;
|
import cn.stylefeng.roses.kernel.jwt.JwtTokenOperator;
|
||||||
import cn.stylefeng.roses.kernel.jwt.api.context.JwtContext;
|
import cn.stylefeng.roses.kernel.jwt.api.context.JwtContext;
|
||||||
|
@ -303,8 +302,7 @@ public class AuthServiceImpl implements AuthServiceApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1.2 判断账号是否密码重试次数过多被冻结
|
// 1.2 判断账号是否密码重试次数过多被冻结
|
||||||
CacheOperatorApi<Integer> tenantCacheProxy = TenantCacheProxyFactory.createTenantCacheProxy(loginRequest.getTenantCode(), loginErrorCountCacheApi);
|
Integer loginErrorCount = loginErrorCountCacheApi.get(loginRequest.getAccount());
|
||||||
Integer loginErrorCount = tenantCacheProxy.get(loginRequest.getAccount());
|
|
||||||
if (loginErrorCount != null && loginErrorCount >= LoginCacheConstants.MAX_ERROR_LOGIN_COUNT) {
|
if (loginErrorCount != null && loginErrorCount >= LoginCacheConstants.MAX_ERROR_LOGIN_COUNT) {
|
||||||
throw new AuthException(AuthExceptionEnum.LOGIN_LOCKED);
|
throw new AuthException(AuthExceptionEnum.LOGIN_LOCKED);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue