按照文档将若依从jdk8升级到17,springboot从2升级到3,发现swagger用不了了。文档中修改SecurityConfig.java,以支持Spring Security6新的配置方式。swagger3的界面在/swagger-ui/index.html。导致被拦截掉。另外可能需要改个.headers(headers -> headers.frameOptions().disable())。否则会导致iframe页面无法渲染。不过我不明白为什么我按照 .requestMatchers("/swagger-ui/", "/swagger-resources/", "/webjars/", "//api-docs", "//api-docs/", "/druid/","/v3/"
,"/swagger-ui.html/**","/error").permitAll()配置了匿名请求,但是swagger却报Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually。
跟项目无关,springboot3不支持集成swagger3
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
可以用,参考:https://doc.ruoyi.vip/ruoyi-vue/document/cjjc.html#%E5%8D%87%E7%BA%A7springboot%E5%88%B0%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC3-x
代码就在最后:提示
插件相关包和代码实现ruoyi-vue/升级springboot到最新版本3.x.zip
链接: https://pan.baidu.com/s/13JVC9jm-Dp9PfHdDDylLCQ 提取码: y9jt
登录 后才可以发表评论