fix: 修复SecurityConfig环境判断,支持h2-test配置

This commit is contained in:
张翔
2026-04-05 08:09:57 +08:00
parent 3051aa7e81
commit e2cb7a5ad4
@@ -36,7 +36,7 @@ public class SecurityConfig {
final boolean isDevOrTest;
isDevOrTest = java.util.Arrays.stream(activeProfiles)
.anyMatch(profile -> "dev".equals(profile) || "test".equals(profile));
.anyMatch(profile -> "dev".equals(profile) || "test".equals(profile) || "h2-test".equals(profile));
logger.info("SecurityConfig初始化: 当前环境={}, Swagger启用状态={}",
activeProfiles.length > 0 ? String.join(",", activeProfiles) : "default", isDevOrTest);