调整
This commit is contained in:
parent
e74ceaebd0
commit
68b1879793
@ -36,18 +36,18 @@ public class MvcConfig implements WebMvcConfigurer {
|
||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void addCorsMappings(CorsRegistry registry) {
|
||||
// registry.addMapping("/**") // 匹配所有的路径
|
||||
// .allowCredentials(true) // 设置允许凭证
|
||||
// .allowedHeaders("*") // 设置请求头
|
||||
// .allowedMethods("GET", "POST", "PUT", "DELETE") // 设置允许的方式
|
||||
// .allowedOriginPatterns("*");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void configurePathMatch(PathMatchConfigurer configurer) {
|
||||
// configurer
|
||||
// .addPathPrefix("/village",c -> c.isAnnotationPresent(RestController.class));
|
||||
// }
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**") // 匹配所有的路径
|
||||
.allowCredentials(true) // 设置允许凭证
|
||||
.allowedHeaders("*") // 设置请求头
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE") // 设置允许的方式
|
||||
.allowedOriginPatterns("*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configurePathMatch(PathMatchConfigurer configurer) {
|
||||
configurer
|
||||
.addPathPrefix("/village",c -> c.isAnnotationPresent(RestController.class));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user