// routes/pages.go // HTML页面路由 package routes import ( "path/filepath" "github.com/gin-gonic/gin" ) // registerPageRoutes 注册HTML页面路由 func registerPageRoutes(r *gin.Engine) { staticPath := getStaticPath() htmlPath := filepath.Join(staticPath, "html") // 公开页面(无需登录)- 普通头部 r.StaticFile("/", filepath.Join(htmlPath, "index.html")) r.StaticFile("/login", filepath.Join(htmlPath, "login.html")) r.StaticFile("/about", filepath.Join(htmlPath, "about.html")) r.StaticFile("/agreement", filepath.Join(htmlPath, "agreement.html")) r.StaticFile("/privacy", filepath.Join(htmlPath, "privacy.html")) r.StaticFile("/growth-rules", filepath.Join(htmlPath, "growth-rules.html")) // Web端页面路由(需登录)- 工作台头部 r.StaticFile("/web/calendar", filepath.Join(htmlPath, "calendar.html")) r.StaticFile("/web/profile", filepath.Join(htmlPath, "profile.html")) r.StaticFile("/web/growth", filepath.Join(htmlPath, "growth.html")) }