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 | 18 | import org.springframework.boot.web.client.RestTemplateBuilder; |
| 19 | 19 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| 20 | 20 | import org.springframework.context.annotation.Bean; |
| 21 | +import org.springframework.core.annotation.Order; | |
| 21 | 22 | import org.springframework.util.AntPathMatcher; |
| 22 | 23 | import org.springframework.web.bind.annotation.RestController; |
| 23 | 24 | import org.springframework.web.client.RestTemplate; |
| ... | ... | @@ -80,6 +81,7 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { |
| 80 | 81 | /** |
| 81 | 82 | * 创建 CorsFilter Bean,解决跨域问题 |
| 82 | 83 | */ |
| 84 | + @Order(value = 0) | |
| 83 | 85 | @Bean |
| 84 | 86 | public FilterRegistrationBean<CorsFilter> corsFilterBean() { |
| 85 | 87 | // 创建 CorsConfiguration 对象 | ... | ... |