From 0724ad79a2320a44c165b37a1104f3d1641dcc97 Mon Sep 17 00:00:00 2001 From: zhangchenhao Date: Fri, 6 Jun 2025 18:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/route/route.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/route/route.go b/backend/route/route.go index 652375a..3f3e55f 100644 --- a/backend/route/route.go +++ b/backend/route/route.go @@ -81,16 +81,16 @@ func Register(r *gin.Engine) { } // 1. 提供静态文件服务 - r.StaticFS("/static", http.Dir("./build/static")) // 静态资源路径 - r.StaticFS("/auto-deploy/static", http.Dir("./build/static")) // 静态资源路径 + r.StaticFS("/static", http.Dir("./frontend/static")) // 静态资源路径 + r.StaticFS("/auto-deploy/static", http.Dir("./frontend/static")) // 静态资源路径 // 返回 favicon.ico r.GET("/favicon.ico", func(c *gin.Context) { - c.File("./build/favicon.ico") + c.File("./frontend/favicon.ico") }) // 3. 前端路由托管:匹配所有其他路由并返回 index.html r.NoRoute(func(c *gin.Context) { - c.File("./build/index.html") + c.File("./frontend/index.html") }) // v2 := r.Group("/v2") // {