1.没找到文档页面,输出了自定义的反馈信息
Paste_Image.png
2.这个问题是资源映射不到导致,swagger-ui.html是在jar包里面,SpringBoot自动配置也找不到这个页面。
问题处理:
@SpringBootApplication
@EnableCaching
public class CmsApplication extends WebMvcConfigurerAdapter{
public static void main(String[] args) {
SpringApplication.run(CmsApplication.class, args);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}
Paste_Image.png
网友评论