This commit is contained in:
zrh050423 2024-12-16 01:12:35 +08:00
parent 06e98a363e
commit 0dcc3389d7
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ public class WebLoginConfig implements WebMvcConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**") // 对所有路径应用此规则 registry.addMapping("/") // 对所有路径应用此规则
.allowedOrigins("http://localhost:3000") // 允许来自这个源的请求 .allowedOrigins("http://localhost:3000") // 允许来自这个源的请求
.allowedMethods("GET", "POST", "PUT", "DELETE") // 允许的HTTP方法 .allowedMethods("GET", "POST", "PUT", "DELETE") // 允许的HTTP方法
.allowedHeaders("*") // 允许的请求头 .allowedHeaders("*") // 允许的请求头