springboot使用的时候 需要设置静态资源以及目录 通过addResourceHandlers方法可以实现相关资源文件的配置:
addResourceHandler("/qy/**") 所有/qy/开头的请求 都会去后面配置的路径下查找资源
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// 添加文档对应的映射
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
// 添加对应的映射
registry.addResourceHandler("/qy/**").addResourceLocations("classpath:/static/qy/");
super.addResourceHandlers(registry);
}