在使用thymeleaf時,swagger2能夠正常使用,將thymeleaf改成vue以後,swagger2頁面報錯html
/** * 發現若是繼承了WebMvcConfigurationSupport,則在yml中配置的相關內容會失效。 須要從新指定靜態資源 * * @param registry */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/**").addResourceLocations( "classpath:/static/"); registry.addResourceHandler("swagger-ui.html").addResourceLocations( "classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/"); super.addResourceHandlers(registry); }