From 076d5b99d238ebcdc9b9b7b136887a69fc2fa333 Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sat, 07 Nov 2026 16:55:04 +0800
Subject: [PATCH] feat: 新增永久卡、密钥冻结、工具管理及公告功能,优化游戏安装逻辑
---
server/handlers/games.go | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/server/handlers/games.go b/server/handlers/games.go
index a4de35d..6b0f3d4 100644
--- a/server/handlers/games.go
+++ b/server/handlers/games.go
@@ -200,9 +200,9 @@
c.JSON(http.StatusOK, gin.H{"code": 1, "msg": "游戏不存在"})
return
}
- // 校验会员是否有效
+ // 校验会员是否有效(永久卡 expired_at 为 NULL)
var keys []models.MemberKey
- config.DB.Where("user_id = ? AND expired_at > ?", userID, time.Now()).Find(&keys)
+ config.DB.Where("user_id = ? AND (expired_at IS NULL OR expired_at > ?)", userID, time.Now()).Find(&keys)
if len(keys) == 0 {
c.JSON(http.StatusOK, gin.H{"code": 2, "msg": "您的会员已到期,无法下载游戏。请激活新的会员密钥!"})
return
@@ -215,7 +215,8 @@
}
config.DB.Model(&game).UpdateColumn("download_count", game.DownloadCount+1)
c.JSON(http.StatusOK, gin.H{"code": 0, "data": gin.H{
- "title": game.Title,
- "files": game.Files,
+ "title": game.Title,
+ "files": game.Files,
+ "launch_exe": game.LaunchExe,
}})
}
--
Gitblit v1.10.0