|
|
|
@ -42,15 +42,15 @@ public class FilterConfig {
|
|
|
|
|
Map<String, String> initParameters = new HashMap<String, String>();
|
|
|
|
|
initParameters.put("excludes", excludes);
|
|
|
|
|
registration.setInitParameters(initParameters);
|
|
|
|
|
|
|
|
|
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
|
|
|
|
CorsConfiguration config = new CorsConfiguration();
|
|
|
|
|
config.setAllowCredentials(true);
|
|
|
|
|
config.addAllowedOrigin("http://39.101.188.84:9999");
|
|
|
|
|
config.addAllowedHeader("*");
|
|
|
|
|
config.addAllowedMethod("*");
|
|
|
|
|
source.registerCorsConfiguration("/**", config); // CORS 配置对所有接口都有效
|
|
|
|
|
registration.setOrder(0);
|
|
|
|
|
//
|
|
|
|
|
// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
|
|
|
|
// CorsConfiguration config = new CorsConfiguration();
|
|
|
|
|
// config.setAllowCredentials(true);
|
|
|
|
|
// config.addAllowedOrigin("http://39.101.188.84:9999");
|
|
|
|
|
// config.addAllowedHeader("*");
|
|
|
|
|
// config.addAllowedMethod("*");
|
|
|
|
|
// source.registerCorsConfiguration("/**", config); // CORS 配置对所有接口都有效
|
|
|
|
|
// registration.setOrder(0);
|
|
|
|
|
|
|
|
|
|
return registration;
|
|
|
|
|
}
|
|
|
|
|