package com.example.lxw.config;
|
|
import org.springframework.context.annotation.Configuration;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
|
/**
|
* @author lxw
|
* @create 2021-04-09 14:58
|
*/
|
@Configuration
|
public class MvcConfig extends WebMvcConfigurationSupport {
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
// 这里之所以多了一"/",是为了解决打jar时访问不到问题
|
registry.addResourceHandler("/index.html").addResourceLocations("/index.html","classpath:/index.html");
|
registry.addResourceHandler("/doc.html").addResourceLocations("/doc.html","classpath:/doc.html");
|
}
|
}
|