swagger被拦截器拦截,不好用
作者:互联网
swagger被拦截器拦截,不好用
解决:在WebMvcConfig文件中进行配置
/**
* 使用拦截器需要在这配置
* 拦截 初始化的菜单(依据用户权限显示)
*
* @param registry todo
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
String[] excludePathArr = {"/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**"};
registry.addInterceptor(authorizationInterceptor).addPathPatterns("/*/**").excludePathPatterns(excludePathArr);
}
标签:拦截器,excludePathArr,webjars,registry,拦截,swagger 来源: https://www.cnblogs.com/yu-zexin/p/16536554.html