From e229e31079546ffee0a35a72cb693d017583e7c3 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 4 May 2026 16:23:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dassets=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84=E6=8B=BC=E6=8E=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Gin的*filepath参数包含开头的/,需要去除 - 修复路径拼接导致的双斜杠问题 - 移除自动刷新逻辑,这不是正确的解决方案 --- backend/cmd/main.go | 1 + frontend/src/router/index.ts | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/cmd/main.go b/backend/cmd/main.go index 7ad373c..3c9b01b 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -264,6 +264,7 @@ func setupEmbeddedFrontend(r *gin.Engine) { r.GET("/assets/*filepath", func(c *gin.Context) { filepath := c.Param("filepath") + filepath = strings.TrimPrefix(filepath, "/") decodedPath, err := url.PathUnescape(filepath) if err != nil { decodedPath = filepath diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index fa2796c..2602ef7 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -13,12 +13,6 @@ const router = createRouter({ }, }) -router.onError((error) => { - if (error.message.includes('Failed to fetch dynamically imported module')) { - window.location.reload() - } -}) - createRouterGuard(router) export default router