写死了 origin 大哥们
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3003"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("content-type", "Authorization", "X-Requested-With", "Origin", "Accept", "X-XSRF-TOKEN"));
configuration.setAllowCredentials(true);
configuration.setMaxAge(3600L);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}
这个 configuration.setAllowedOrigins(Arrays.asList("http://localhost:3003")); 这个玩意为啥要写死啊,我部署到k8s后 用域名一直请求不通
现在我只能用 postman 手动调用接口 指定 Origin、Referer
真狗啊

写死了 origin 大哥们
这个 configuration.setAllowedOrigins(Arrays.asList("http://localhost:3003")); 这个玩意为啥要写死啊,我部署到k8s后 用域名一直请求不通
现在我只能用 postman 手动调用接口 指定 Origin、Referer
真狗啊