Commit 3affec34d8eeb4b8402369937c044abd0194cadc
1 parent
8fd0f729
【功能调整】全局:默认 /app-api/* 需要登录,和 /admin-api/* 保持一致,降低大家理解成本
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java
| @@ -129,14 +129,14 @@ public class YudaoWebSecurityConfigurerAdapter { | @@ -129,14 +129,14 @@ public class YudaoWebSecurityConfigurerAdapter { | ||
| 129 | .authorizeHttpRequests(c -> c | 129 | .authorizeHttpRequests(c -> c |
| 130 | // 1.1 静态资源,可匿名访问 | 130 | // 1.1 静态资源,可匿名访问 |
| 131 | .requestMatchers(HttpMethod.GET, "/*.html", "/*.html", "/*.css", "/*.js").permitAll() | 131 | .requestMatchers(HttpMethod.GET, "/*.html", "/*.html", "/*.css", "/*.js").permitAll() |
| 132 | - // 1.1 设置 @PermitAll 无需认证 | 132 | + // 1.2 设置 @PermitAll 无需认证 |
| 133 | .requestMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll() | 133 | .requestMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll() |
| 134 | .requestMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll() | 134 | .requestMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll() |
| 135 | .requestMatchers(HttpMethod.PUT, permitAllUrls.get(HttpMethod.PUT).toArray(new String[0])).permitAll() | 135 | .requestMatchers(HttpMethod.PUT, permitAllUrls.get(HttpMethod.PUT).toArray(new String[0])).permitAll() |
| 136 | .requestMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll() | 136 | .requestMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll() |
| 137 | .requestMatchers(HttpMethod.HEAD, permitAllUrls.get(HttpMethod.HEAD).toArray(new String[0])).permitAll() | 137 | .requestMatchers(HttpMethod.HEAD, permitAllUrls.get(HttpMethod.HEAD).toArray(new String[0])).permitAll() |
| 138 | .requestMatchers(HttpMethod.PATCH, permitAllUrls.get(HttpMethod.PATCH).toArray(new String[0])).permitAll() | 138 | .requestMatchers(HttpMethod.PATCH, permitAllUrls.get(HttpMethod.PATCH).toArray(new String[0])).permitAll() |
| 139 | - // 1.2 基于 yudao.security.permit-all-urls 无需认证 | 139 | + // 1.3 基于 yudao.security.permit-all-urls 无需认证 |
| 140 | .requestMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll() | 140 | .requestMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll() |
| 141 | ) | 141 | ) |
| 142 | // ②:每个项目的自定义规则 | 142 | // ②:每个项目的自定义规则 |