【若依(ruoyi)】swagger 自定义 swagger-ui.html 的路径
前言
- springfox-swagger 2.9.2
- spring boot 2.2.13.RELEASE
- http://springfox.github.io/springfox/
自定義 swagger-ui.html 的路徑
默認(rèn)的路徑:http://localhost:8080/swagger-ui.html
如果想修改這個(gè)路徑為:http://localhost:8080/rest/api/doc/swagger-ui.html,就需要自定義 swagger-ui.html 的路徑。
方法1
可以參考這里(https://github.com/springfox/springfox/issues/1080),方法很多。
但修改的結(jié)果是,增加訪問路徑 http://localhost:8080/rest/api/doc/swagger-ui.html,但無法將原來的路徑禁用掉。因?yàn)?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
總結(jié)
以上是生活随笔為你收集整理的【若依(ruoyi)】swagger 自定义 swagger-ui.html 的路径的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 地黄根的功效与作用、禁忌和食用方法
- 下一篇: 韭菜种子的功效与作用、禁忌和食用方法