3.2K Star 34.4K Fork 24.5K

若依 / RuoYi-Vue

 / 详情

若依升级到springboot3后swagger3出现的问题

待办的
创建于  
2024-03-28 17:01

按照文档将若依从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。

评论 (2)

付申祺 创建了任务

跟项目无关,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

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
2228137 roach lin 1661874844
JavaScript
1
https://gitee.com/y_project/RuoYi-Vue.git
git@gitee.com:y_project/RuoYi-Vue.git
y_project
RuoYi-Vue
RuoYi-Vue

搜索帮助

344bd9b3 5694891 D2dac590 5694891