版权声明:转载请注明出处 https://blog.csdn.net/C1041067258/article/details/82882195
配置swagger文档,被拦截器拦截不能使用
拦截器中添加以下配置,适当修改即可使用
重写addInterceptors
registry.addInterceptor(new UserInterceptor()).addPathPatterns("/**")
.excludePathPatterns("/rest/login.do/info")
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**");
重写addResourceHandlers
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");