dengbiao 1 周之前
父節點
當前提交
8cc3fa8f2f
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      app/router/router.go

+ 7
- 1
app/router/router.go 查看文件

@@ -5,6 +5,7 @@ import (
"applet/app/hdl"
"applet/app/mw"
_ "applet/docs"
"fmt"
"github.com/gin-gonic/gin"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
@@ -36,7 +37,12 @@ func Init() *gin.Engine {
requestTls = "https://"
}
r.Use(mw.SwagAuth())
ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL(requestTls+c.GetHeader("X-Host")+"/api/api-docs/open.json"))(c)
fmt.Println(requestTls + c.GetHeader("X-Host") + "/api/api-docs/open.json")
if c.GetHeader("X-Host") != "" {
ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL(requestTls+c.GetHeader("X-Host")+"/api/api-docs/open.json"))(c)
} else {
ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.URL(requestTls+c.Request.Host+"/api/api-docs/open.json"))(c)
}
})
r.Use(mw.ChangeHeader)



Loading…
取消
儲存