vue项目路由history模式下,springboot配置
public static void main(String[] args) {
SpringApplication application = new SpringApplication(BackApplication.class);
context = application.run();
}
@Bean
public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer(){
return new WebServerFactoryCustomizer<ConfigurableWebServerFactory>() {
@Override
public void customize(ConfigurableWebServerFactory factory) {
// factory.setPort(8081);
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
Set<ErrorPage> errorPages = new HashSet<>();
errorPages.add(error404Page);
factory.setErrorPages(errorPages);
}
};
}
本文标题:vue项目路由history模式下,springboot配置
本文链接:https://www.haomeiwen.com/subject/npaeohtx.html
网友评论