fix: 客户端版本不在列表中时视为需要更新而非报错

This commit is contained in:
Trae AI
2026-06-21 16:31:25 +08:00
parent 0a7392f30d
commit 0e0629d809
+6 -3
View File
@@ -159,10 +159,13 @@ func handleAppCheckUpdate(c *gin.Context) {
}
}
// 客户端版本不存在于服务器版本列表中,返回参数错误
// 客户端版本不存在于服务器版本列表中,视为需要更新
// 构造一个虚拟的客户端版本记录,ID为0,确保所有服务器版本都比它新
if clientVersionRecord == nil {
response.Error(c, 400, "版本号参数错误")
return
clientVersionRecord = &model.Version{
ID: 0,
Version: clientVersion,
}
}
// 判断客户端版本状态:检查是否有更高ID的强制更新版本