Commit 276e8bf9ff33cdc3f44bcc774267264e26ccc846
1 parent
8645e88d
fixed: 修复因执行顺序影响到跨域配置不生效问题
Showing
1 changed file
with
2 additions
and
0 deletions
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
| @@ -18,6 +18,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties | @@ -18,6 +18,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties | ||
| 18 | import org.springframework.boot.web.client.RestTemplateBuilder; | 18 | import org.springframework.boot.web.client.RestTemplateBuilder; |
| 19 | import org.springframework.boot.web.servlet.FilterRegistrationBean; | 19 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| 20 | import org.springframework.context.annotation.Bean; | 20 | import org.springframework.context.annotation.Bean; |
| 21 | +import org.springframework.core.annotation.Order; | ||
| 21 | import org.springframework.util.AntPathMatcher; | 22 | import org.springframework.util.AntPathMatcher; |
| 22 | import org.springframework.web.bind.annotation.RestController; | 23 | import org.springframework.web.bind.annotation.RestController; |
| 23 | import org.springframework.web.client.RestTemplate; | 24 | import org.springframework.web.client.RestTemplate; |
| @@ -80,6 +81,7 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { | @@ -80,6 +81,7 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { | ||
| 80 | /** | 81 | /** |
| 81 | * 创建 CorsFilter Bean,解决跨域问题 | 82 | * 创建 CorsFilter Bean,解决跨域问题 |
| 82 | */ | 83 | */ |
| 84 | + @Order(value = 0) | ||
| 83 | @Bean | 85 | @Bean |
| 84 | public FilterRegistrationBean<CorsFilter> corsFilterBean() { | 86 | public FilterRegistrationBean<CorsFilter> corsFilterBean() { |
| 85 | // 创建 CorsConfiguration 对象 | 87 | // 创建 CorsConfiguration 对象 |