Commit d03b1ddc authored by Shen's avatar Shen

1.配置静态资源访问,解决静态资源访问和swagger冲突的问题。

parent 675396ef
package io.hmit.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
/**
* @Description : TODO
* @Author : Shen Yuanfeng
* @Date : 2021/5/7 13:48
*/
@Configuration
public class StaticMvcConfigurer extends WebMvcConfigurationSupport {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**")
.addResourceLocations("file:D:/123/");
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/","classpath:/META-INF/resources/webjars/");
super.addResourceHandlers(registry);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment