refactor: 移除后端跨域配置,由前端代理处理
- 移除 FileUploadController 的 @CrossOrigin 注解 - 恢复 WebMvcConfig 拦截器配置
This commit is contained in:
@@ -20,10 +20,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(authInterceptor)
|
||||
.addPathPatterns("/**")
|
||||
.excludePathPatterns("/uploads/**")
|
||||
.excludePathPatterns("/api/upload/**");
|
||||
registry.addInterceptor(authInterceptor).addPathPatterns("/**")
|
||||
.excludePathPatterns("/uploads/**");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@CrossOrigin(origins = "*", allowedHeaders = "*", methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE, RequestMethod.OPTIONS})
|
||||
public class FileUploadController {
|
||||
|
||||
@Value("${app.upload-path:./uploads}")
|
||||
|
||||
Reference in New Issue
Block a user