mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-13 18:44:14 +08:00
f
This commit is contained in:
parent
f4f79dc29f
commit
fb99d9c409
1 changed files with 2 additions and 3 deletions
|
|
@ -31,10 +31,9 @@ func swaggerHandler() gin.HandlerFunc {
|
|||
fileServer := http.StripPrefix("/1panel/swagger/", http.FileServer(http.FS(subFS)))
|
||||
|
||||
return func(c *gin.Context) {
|
||||
path := c.Param("any")
|
||||
path := c.Request.URL.Path
|
||||
path = strings.TrimPrefix(path, "/1panel/swagger")
|
||||
switch path {
|
||||
case "/", "/index.html", "":
|
||||
c.Redirect(http.StatusMovedPermanently, "/1panel/swagger/index.html")
|
||||
case "/doc.json":
|
||||
c.Header("Content-Type", "application/json; charset=utf-8")
|
||||
c.String(http.StatusOK, docs.SwaggerInfo.ReadDoc())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue