From fb99d9c409058a4ffcdc0de16cf6c1a515dd1482 Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Mon, 24 Nov 2025 14:35:13 +0800 Subject: [PATCH] f --- core/init/router/router.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/init/router/router.go b/core/init/router/router.go index 01fe4f1e9..5216e043d 100644 --- a/core/init/router/router.go +++ b/core/init/router/router.go @@ -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())