From 97f3c16ac595493405e8cf76399dc703c088ef6f Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期二, 03 十二月 2024 15:56:11 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/security/config/SecurityConfiguration.java | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/security/config/SecurityConfiguration.java b/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/security/config/SecurityConfiguration.java index 825057b..7878f92 100644 --- a/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/security/config/SecurityConfiguration.java +++ b/iailab-module-report/iailab-module-report-biz/src/main/java/com/iailab/module/report/framework/security/config/SecurityConfiguration.java @@ -4,7 +4,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; +import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer; /** * Report 模块的 Security 配置 @@ -17,20 +17,23 @@ return new AuthorizeRequestsCustomizer() { @Override - public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) { + public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) { // Swagger 接口文档 - registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据 - .antMatchers("/swagger-ui.html").permitAll(); // Swagger UI + registry.requestMatchers("/v3/api-docs/**").permitAll() + .requestMatchers("/webjars/**").permitAll() + .requestMatchers("/swagger-ui").permitAll() + .requestMatchers("/swagger-ui/**").permitAll(); // Spring Boot Actuator 的安全配置 - registry.antMatchers("/actuator").anonymous() - .antMatchers("/actuator/**").anonymous(); + registry.requestMatchers("/actuator").permitAll() + .requestMatchers("/actuator/**").permitAll(); // Druid 监控 - registry.antMatchers("/druid/**").anonymous(); + registry.requestMatchers("/druid/**").permitAll(); // 积木报表 - registry.antMatchers("/jmreport/**").permitAll(); + registry.requestMatchers("/jmreport/**").permitAll(); + // 积木仪表盘排除 + registry.requestMatchers("/drag/**").permitAll(); } }; } - } -- Gitblit v1.9.3