Swagger 配置

放行 , 不拦截.

@Configuration
open class MyWebMvcConfig : WebMvcConfigurationSupport() {
    override fun addResourceHandlers( registry: ResourceHandlerRegistry) {
        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);
    }
}

不显示 basic-error-controller

https://blog.csdn.net/m0_37948170/article/details/80834718

 .paths(Predicates.not(PathSelectors.regex("/error.*")))
posted @ 2018-12-21 12:59  NewSea  阅读(534)  评论(0编辑  收藏  举报