多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## Swagger-ui配置 > 去swagger-ui官网下载静态页面,把静态页面放到thinkphp框架目录里,例如public目录。 > 官网地址:[https://swagger.io/tools/swagger-ui/](https://swagger.io/tools/swagger-ui/) > 找到swagger-ui下的dist/index.html ``` window.onload = function() { // Begin Swagger UI call region const ui = SwaggerUIBundle({ //url:"http://www.tp.com.cn/swagger.json", //单文档地址 urls:[{url:"http://www.tp.com.cn/swagger.json",name:"前端文档"},{url:"http://www.tp.com.cn/swagger-1.json",name:"后端文档"}], //开启Topbar插件支持多个文档 dom_id: '#swagger-ui', deepLinking: false, validatorUrl: null, //关闭验证规则 presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], layout: "StandaloneLayout" }) ``` > 打开浏览器访问 [http://www.tp.com.cn/swagger-ui/dist/index.html]() 更多配置参数访问: [https://github.com/swagger-api/swagger-ui/blob/v3.18.3/docs/usage/configuration.md](https://github.com/swagger-api/swagger-ui/blob/v3.18.3/docs/usage/configuration.md)