vue项目路由history模式下,springboot配置

2020-05-17  本文已影响0人  dongzhensong
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);
            }
        };
    }
上一篇 下一篇

猜你喜欢

热点阅读