|
|
@@ -5,8 +5,6 @@ import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.web.cors.CorsConfiguration;
|
|
|
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
|
|
import org.springframework.web.filter.CorsFilter;
|
|
|
-import org.springframework.web.reactive.config.CorsRegistry;
|
|
|
-
|
|
|
/**
|
|
|
* @author lifang
|
|
|
* @version 1.0.0
|
|
|
@@ -15,7 +13,7 @@ import org.springframework.web.reactive.config.CorsRegistry;
|
|
|
* @createTime 2021年10月18日 16:47:00
|
|
|
*/
|
|
|
@Configuration
|
|
|
-public class CroConfiguration {
|
|
|
+public class CroConfiguration{
|
|
|
@Bean
|
|
|
public CorsFilter corsFilter() {
|
|
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
|
|
@@ -29,8 +27,8 @@ public class CroConfiguration {
|
|
|
// 可访问的外部域
|
|
|
config.addAllowedOrigin("*");
|
|
|
// 需要跨域用户凭证(cookie、HTTP认证及客户端SSL证明等)
|
|
|
- //config.setAllowCredentials(true);
|
|
|
- //config.addAllowedOriginPattern("*");
|
|
|
+ config.setAllowCredentials(true);
|
|
|
+// config.addAllowedOriginPattern("*");
|
|
|
|
|
|
// 跨域路径配置
|
|
|
source.registerCorsConfiguration("/**", config);
|