From 6cc9b12b81d184bb2df9dc68f93ca45c3d47d229 Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sun, 08 Nov 2026 17:31:58 +0800
Subject: [PATCH] feat(server): 添加游戏目录公开浏览页并更新重启脚本提示

---
 server/main.go |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/server/main.go b/server/main.go
index 3a1e2bc..44ec722 100644
--- a/server/main.go
+++ b/server/main.go
@@ -1,6 +1,7 @@
 package main
 
 import (
+	"net/http"
 	"os"
 	"path/filepath"
 
@@ -39,8 +40,9 @@
 		api.GET("/games", handlers.GetGames)
 		api.GET("/banners", handlers.GetBanners)
 		api.GET("/tools", handlers.GetTools)
+		api.GET("/tools/:id/download", handlers.ToolDownloadInfo)
 		api.GET("/announcements", handlers.GetAnnouncements)
-		api.GET("/games/:id", handlers.GetGameDetail) // 支持可选登录
+		api.GET("/games/:id", middleware.OptionalUserAuth(), handlers.GetGameDetail) // 支持可选登录:登录后返回收藏/资源库状态
 
 		auth := api.Group("", middleware.UserAuth())
 		{
@@ -55,6 +57,14 @@
 		}
 	}
 
+	// ---------- 游戏目录展示页(公开,仅浏览不可下载) ----------
+	r.GET("/showcase", func(c *gin.Context) {
+		c.File("./showcase/index.html")
+	})
+	r.GET("/", func(c *gin.Context) {
+		c.Redirect(http.StatusFound, "/showcase")
+	})
+
 	// ---------- 管理后台 ----------
 	r.GET("/admin", func(c *gin.Context) {
 		c.File("./admin/index.html")
@@ -88,6 +98,11 @@
 			a.POST("/announcement", handlers.AdminSaveAnnouncement)
 
 			a.POST("/upload", handlers.UploadFile)
+
+			// 密码重置申请管理
+			a.GET("/reset_requests", handlers.ListResetRequests)
+			a.POST("/reset_requests/:id/approve", handlers.ApproveResetRequest)
+			a.DELETE("/reset_requests/:id", handlers.DeleteResetRequest)
 		}
 	}
 

--
Gitblit v1.10.0