diff --git a/backend/internal/router/admin/versions.go b/backend/internal/router/admin/versions.go index 5461be6..a406767 100644 --- a/backend/internal/router/admin/versions.go +++ b/backend/internal/router/admin/versions.go @@ -367,6 +367,10 @@ func handleCreateVersionGlobal(c *gin.Context) { type UpdateVersionRequest struct { Version string `json:"version"` + FilePath string `json:"file_path"` + FileSize int64 `json:"file_size"` + FileHash string `json:"file_hash"` + EntryFile string `json:"entry_file"` UpdateStrategy string `json:"update_strategy"` UpdateType string `json:"update_type"` UpdateMethod string `json:"update_method"` @@ -420,6 +424,16 @@ func handleUpdateVersionGlobal(c *gin.Context) { if req.Version != "" { updates["version"] = req.Version } + if req.FilePath != "" { + updates["file_path"] = req.FilePath + } + if req.FileSize > 0 { + updates["file_size"] = req.FileSize + } + if req.FileHash != "" { + updates["file_hash"] = req.FileHash + } + updates["entry_file"] = req.EntryFile if req.UpdateStrategy != "" { updates["update_strategy"] = req.UpdateStrategy } diff --git a/frontend/src/pages/admin/versions/[id].vue b/frontend/src/pages/admin/versions/[id].vue index ad20cd6..745c93f 100644 --- a/frontend/src/pages/admin/versions/[id].vue +++ b/frontend/src/pages/admin/versions/[id].vue @@ -219,6 +219,12 @@ async function handleSubmit() { const response = await api.put(`/dev/versions/${versionId.value}`, payload) console.log('[DEBUG] handleSubmit response:', response) + + // 更新原始数据为最新保存的数据 + if (uploadedData.value) { + originalUploadedData.value = { ...uploadedData.value } + } + toast.success(t('admin.versions.createForm.updateSuccess')) router.push('/admin/versions') }