|
@@ -16,31 +16,27 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupp
|
|
|
@Configuration
|
|
|
public class WebConfigurer extends WebMvcConfigurationSupport {
|
|
|
|
|
|
- @Override
|
|
|
- public void addInterceptors(InterceptorRegistry registry) {
|
|
|
+ @Override
|
|
|
+ public void addInterceptors(InterceptorRegistry registry) {
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
|
- registry.addResourceHandler("swagger-ui.html")
|
|
|
- .addResourceLocations("classpath:/META-INF/resources/");
|
|
|
- registry.addResourceHandler("/webjars/**")
|
|
|
- .addResourceLocations("classpath:/META-INF/resources/webjars/");
|
|
|
- }
|
|
|
+ @Override
|
|
|
+ protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
|
+ registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
|
|
+ registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 添加跨域请求支持
|
|
|
- * @param registry
|
|
|
- */
|
|
|
- @Override
|
|
|
- public void addCorsMappings(CorsRegistry registry) {
|
|
|
- log.warn("开启跨域支持");
|
|
|
- registry.addMapping("/**")
|
|
|
- .allowedOrigins("*")
|
|
|
- .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
|
|
|
- .maxAge(3600)
|
|
|
- .allowCredentials(true);
|
|
|
- super.addCorsMappings(registry);
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 添加跨域请求支持
|
|
|
+ *
|
|
|
+ * @param registry
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void addCorsMappings(CorsRegistry registry) {
|
|
|
+ log.warn("开启跨域支持");
|
|
|
+ registry.addMapping("/**").allowedOrigins("*").allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
|
|
|
+ .maxAge(3600).allowCredentials(true);
|
|
|
+ super.addCorsMappings(registry);
|
|
|
+ }
|
|
|
}
|