diff --git a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java index c967bb0ad..5cd6fa220 100644 --- a/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java +++ b/kernel-d-auth/auth-sdk/src/main/java/cn/stylefeng/roses/kernel/auth/auth/AuthServiceImpl.java @@ -476,7 +476,12 @@ public class AuthServiceImpl implements AuthServiceApi { if (loginErrorCount == null) { loginErrorCount = 0; } - loginErrorCountCacheApi.put(loginRequest.getAccount(), loginErrorCount + 1); + + // 演示环境,不记录error次数 + if (!DemoConfigExpander.getDemoEnvFlag()) { + loginErrorCountCacheApi.put(loginRequest.getAccount(), loginErrorCount + 1); + } + throw new AuthException(AuthExceptionEnum.USERNAME_PASSWORD_ERROR); } }