有可能出现的原因:
1.Security将访问拦截掉了
2.给拦截器拦截了
3.Swagger返回的结果,被自己定义的拦截器or其他方式给篡改了数据,导致无法正常显示,也就无法得到想要的结果
//忽略swagger访问权限限制 .antMatchers( "/userlogin", "/userlogout", "/userjwt", "/v2/api-docs", "/swagger-resources/configuration/ui", "/swagger-resources", "/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",
这几项必须都加上才生效。