From 857e55ca72818cd0a3f8771335977fd9f3de9a2f Mon Sep 17 00:00:00 2001 From: Trae AI Date: Sun, 21 Jun 2026 18:47:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E6=96=B0=E4=B8=8A=E4=BC=A0zip?= =?UTF-8?q?=E5=8C=85=E6=97=B6=E8=87=AA=E5=8A=A8=E6=B8=85=E7=A9=BAentry=5Ff?= =?UTF-8?q?ile/entry=5Ffiles/desktop=5Fshortcut=5Ffiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/router/admin/versions.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/internal/router/admin/versions.go b/backend/internal/router/admin/versions.go index 083fe45..63549be 100644 --- a/backend/internal/router/admin/versions.go +++ b/backend/internal/router/admin/versions.go @@ -529,6 +529,19 @@ func handleUpdateVersionGlobal(c *gin.Context) { if req.Version != "" { updates["version"] = req.Version } + + // 当文件路径变化时(重新上传了新包),清空快捷方式和启动文件字段 + // 因为新包的文件列表可能和旧包不同,旧的选择可能不再有效 + if req.FilePath != "" && req.FilePath != version.FilePath { + updates["entry_file"] = "" + updates["entry_files"] = "" + updates["desktop_shortcut_files"] = "" + } else { + updates["entry_file"] = req.EntryFile + updates["entry_files"] = req.EntryFiles + updates["desktop_shortcut_files"] = req.DesktopShortcutFiles + } + if req.FilePath != "" { updates["file_path"] = req.FilePath } @@ -538,9 +551,6 @@ func handleUpdateVersionGlobal(c *gin.Context) { if req.FileHash != "" { updates["file_hash"] = req.FileHash } - updates["entry_file"] = req.EntryFile - updates["entry_files"] = req.EntryFiles - updates["desktop_shortcut_files"] = req.DesktopShortcutFiles if req.UpdateStrategy != "" { updates["update_strategy"] = req.UpdateStrategy }