|
@@ -5,6 +5,7 @@ import ( |
|
|
"applet/app/hdl" |
|
|
"applet/app/hdl" |
|
|
"applet/app/mw" |
|
|
"applet/app/mw" |
|
|
_ "applet/docs" |
|
|
_ "applet/docs" |
|
|
|
|
|
"fmt" |
|
|
"github.com/gin-gonic/gin" |
|
|
"github.com/gin-gonic/gin" |
|
|
swaggerFiles "github.com/swaggo/files" |
|
|
swaggerFiles "github.com/swaggo/files" |
|
|
ginSwagger "github.com/swaggo/gin-swagger" |
|
|
ginSwagger "github.com/swaggo/gin-swagger" |
|
@@ -36,7 +37,12 @@ func Init() *gin.Engine { |
|
|
requestTls = "https://" |
|
|
requestTls = "https://" |
|
|
} |
|
|
} |
|
|
r.Use(mw.SwagAuth()) |
|
|
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) |
|
|
r.Use(mw.ChangeHeader) |
|
|
|
|
|
|
|
|