ResourceMvcConfig

This commit is contained in:
MaxKey
2023-12-12 09:11:00 +08:00
parent ef757b9182
commit fc7c8fd2ef
7 changed files with 43 additions and 76 deletions

View File

@@ -30,7 +30,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
@@ -47,30 +46,6 @@ public class MaxKeyMgtMvcConfig implements WebMvcConfigurer {
@Autowired
PermissionInterceptor permissionInterceptor;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
logger.debug("add Resource Handlers");
logger.debug("add statics");
registry.addResourceHandler("/static/**")
.addResourceLocations("classpath:/static/");
logger.debug("add templates");
registry.addResourceHandler("/templates/**")
.addResourceLocations("classpath:/templates/");
logger.debug("add swagger");
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
logger.debug("add knife4j");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
logger.debug("add Resource Handler finished .");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {