提交 f0f628d6 authored 作者: 李秋林's avatar 李秋林

关闭跨域

上级 dfb7515e
......@@ -35,16 +35,16 @@ public class ResourcesConfig implements WebMvcConfigurer
.addResourceLocations("file:" + localFilePath + File.separator);
}
/**
* 开启跨域
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
// 设置允许跨域的路由
registry.addMapping(localFilePrefix + "/**")
// 设置允许跨域请求的域名
.allowedOrigins("*")
// 设置允许的方法
.allowedMethods("GET");
}
// /**
// * 开启跨域
// */
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// // 设置允许跨域的路由
// registry.addMapping(localFilePrefix + "/**")
// // 设置允许跨域请求的域名
// .allowedOrigins("*")
// // 设置允许的方法
// .allowedMethods("GET");
// }
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论