SpringBoot整合Security+Swagger2踩坑记录,Swagger2⽆法
访。。。
有可能出现的原因:
1.Security将访问拦截掉了
2.给拦截了
3.Swagger返回的结果,被⾃⼰定义的or其他⽅式给篡改了数据,导致⽆法正常显⽰,也就⽆法得到想要的结果
//忽略swagger访问权限限制
.antMatchers(
"/userlogin",
"/userlogout",
"/userjwt",
"/v2/api-docs",
"/swagger-resources/configuration/ui",
"/swagger-resources",springboot和过滤器
"/swagger-resources/configuration/security",
"/swagger-ui.html",
"/css/**",
"/js/**",
"/images/**",
"/webjars/**",
"/import/test",
"**/favicon.ico",
"/index").permitAll()
其中
"/v2/api-docs",
"/swagger-resources/configuration/ui",
"/swagger-resources",
"/swagger-resources/configuration/security",
"/swagger-ui.html",
这⼏项必须都加上才⽣效。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论