Commit 03a04b7e authored by 赵啸非's avatar 赵啸非

提交配置校验

parent 990b5f2b
...@@ -23,9 +23,9 @@ public class CorsConfig implements WebMvcConfigurer { ...@@ -23,9 +23,9 @@ public class CorsConfig implements WebMvcConfigurer {
CorsConfiguration configuration = new CorsConfiguration(); CorsConfiguration configuration = new CorsConfiguration();
//允许跨域访问的域名 //允许跨域访问的域名
//configuration.addAllowedOrigin("*"); //configuration.addAllowedOrigin("*");
// configuration.setAllowCredentials(true); //运行携带cookie configuration.setAllowCredentials(true); //运行携带cookie
//configuration.addAllowedMethod("*"); //代表所有请求方法 configuration.addAllowedMethod("*"); //代表所有请求方法
//configuration.addAllowedHeader("*"); //允许携带任何头信息 configuration.addAllowedHeader("*"); //允许携带任何头信息
//初始化cors配置源对象 //初始化cors配置源对象
UrlBasedCorsConfigurationSource configurationSource=new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource configurationSource=new UrlBasedCorsConfigurationSource();
...@@ -41,7 +41,7 @@ public class CorsConfig implements WebMvcConfigurer { ...@@ -41,7 +41,7 @@ public class CorsConfig implements WebMvcConfigurer {
.allowCredentials(true) .allowCredentials(true)
//.allowedOrigins("*") //.allowedOrigins("*")
.allowedMethods(new String[] { "GET", "POST","PUT","DELETE"}) .allowedMethods(new String[] { "GET", "POST","PUT","DELETE"})
// .allowedHeaders("*") .allowedHeaders("*")
.exposedHeaders("*"); .exposedHeaders("*");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment