Compare commits
2 Commits
9d1150beb1
...
becfabee80
| Author | SHA1 | Date |
|---|---|---|
|
|
becfabee80 | |
|
|
1c3f7c19c6 |
|
|
@ -1,27 +0,0 @@
|
||||||
package org.qinan.safetyeval.start.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
|
||||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
|
||||||
import org.springframework.web.filter.CorsFilter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 本地联调跨域配置
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class WebCorsConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public CorsFilter corsFilter() {
|
|
||||||
CorsConfiguration config = new CorsConfiguration();
|
|
||||||
config.addAllowedOriginPattern("*");
|
|
||||||
config.addAllowedHeader("*");
|
|
||||||
config.addAllowedMethod("*");
|
|
||||||
config.setAllowCredentials(true);
|
|
||||||
|
|
||||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
|
||||||
source.registerCorsConfiguration("/**", config);
|
|
||||||
return new CorsFilter(source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue