diff options
| author | zyh <[email protected]> | 2024-11-15 16:44:17 +0800 |
|---|---|---|
| committer | zyh <[email protected]> | 2024-11-15 16:44:17 +0800 |
| commit | 784af85641e1f6efca8ea2ff1bcf97d69aa5ef94 (patch) | |
| tree | ef3231d28a39f9c7f0b945d8f059a389e9981315 | |
| parent | 8cb3bf352c197d47484dc311e6e014919e681417 (diff) | |
fix: 修改packages编辑传参方式
| -rw-r--r-- | src/views/packages/edit.vue | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/views/packages/edit.vue b/src/views/packages/edit.vue index 1b3d772..ba978a6 100644 --- a/src/views/packages/edit.vue +++ b/src/views/packages/edit.vue @@ -166,18 +166,14 @@ const save = async () => { submitting.value = true; await ruleFormRef.value.validate(async (valid, fields) => { if (valid) { + const params = new FormData(); + params.append('name', ruleForm.name); + params.append('description', ruleForm.description); let res = null; if (ruleForm.id) { - const params = { - packageId: ruleForm.id, - name: ruleForm.name, - description: ruleForm.description, - }; + params.append('packageId', ruleForm.id); res = await packageEditApi(workspace.value.id, params); } else { - const params = new FormData(); - params.append('name', ruleForm.name); - params.append('description', ruleForm.description); params.append('file', uploadFileList.value[0].raw); res = await packageAddApi(workspace.value.id, params); } |
