【若依(ruoyi)】swagger 自定义 swagger-ui.html 的路径
前言
- springfox-swagger 2.9.2
- spring boot 2.2.13.RELEASE
- http://springfox.github.io/springfox/
自定义 swagger-ui.html 的路径
默认的路径:http://localhost:8080/swagger-ui.html
如果想修改这个路径为:http://localhost:8080/rest/api/doc/swagger-ui.html,就需要自定义 swagger-ui.html 的路径。
方法1
可以参考这里(https://github.com/springfox/springfox/issues/1080),方法很多。
但修改的结果是,增加访问路径 http://localhost:8080/rest/api/doc/swagger-ui.html,但无法将原来的路径禁用掉。因为/swagger-resources/configuration/ui路径是硬编码在js里了,参考这里:https://github.com/springfox/springfox/blob/master/springfox-swagger-ui/src/web/js/springfox.js#L4。
方法2
参考这里:https://www.jianshu.com/p/ce7e247515f5。提供了修改js的方法,即解决了方法1中未解决的问题。
参考
https://blog.csdn.net/u014207158/article/details/89947199
https://github.com/springfox/springfox/issues/1080
https://www.jianshu.com/p/ce7e247515f5
总结
以上是生活随笔为你收集整理的【若依(ruoyi)】swagger 自定义 swagger-ui.html 的路径的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 地黄根的功效与作用、禁忌和食用方法
- 下一篇: 【spring boot】支持webja