|
|
@@ -10,7 +10,7 @@ public class CorsConfig implements WebMvcConfigurer {
|
|
|
@Override
|
|
|
public void addCorsMappings(CorsRegistry registry) {
|
|
|
registry.addMapping("/api/**") // 指定需要跨域的路径
|
|
|
- .allowedOrigins("http://localhost:5173") // 允许的源
|
|
|
+ .allowedOrigins("http://localhost:3000") // 允许的源
|
|
|
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 允许的方法
|
|
|
.allowedHeaders("*") // 允许的头信息
|
|
|
.exposedHeaders("X-Custom-Header") // 暴露给前端的头部
|