This commit is contained in:
2025-03-26 14:31:57 +08:00
parent 48a3dfb313
commit a1eb29c49d
3 changed files with 25 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
public CorsFilter corsFilter() {
final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
final CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
// config.setAllowCredentials(true);
// 允许向该服务器提交请求的URI,*表示全部允许,在SpringMVC中,如果设成*,会自动转成当前请求头中的Origin
config.addAllowedOrigin("*");
// 允许访问的头信息,*表示全部