diff --git a/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue b/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue index 34d3541521..a3bbcaff76 100644 --- a/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue +++ b/frontend/src/views/api-test/scenario/components/common/customApiDrawer.vue @@ -1224,9 +1224,9 @@ stepType: props.step?.stepType, refType: props.step?.refType, isTempFile: false, // 复制未保存的步骤时 true - fileIds: Object.values(parseRequestBodyFiles(res.request.body, [], [], [])).flat(), + fileIds: parseRequestBodyFiles(res.request.body, [], [], []).uploadFileIds, }); - parseRequestBodyFiles(res.body, [], [], [], copyStepFileIdsMap.value); + parseRequestBodyFiles(res.request.body, [], [], [], copyStepFileIdsMap.value); } else { parseRequestBodyResult = parseRequestBodyFiles(res.request.body, [], [], [], copyStepFileIdsMap.value); // 解析请求体中的文件,将详情中的文件 id 集合收集,更新时以判断文件是否删除以及是否新上传的文件 } diff --git a/frontend/src/views/api-test/scenario/components/step/stepTree.vue b/frontend/src/views/api-test/scenario/components/step/stepTree.vue index c4c48ac9e1..8aeb53e63e 100644 --- a/frontend/src/views/api-test/scenario/components/step/stepTree.vue +++ b/frontend/src/views/api-test/scenario/components/step/stepTree.vue @@ -949,7 +949,7 @@ stepType: node.stepType, refType: node.refType, isTempFile: !!stepDetail, // 复制未保存的步骤时 true - fileIds: Object.values(parseRequestBodyFiles((stepDetail as RequestParam).body, [], [], [])).flat(), + fileIds: parseRequestBodyFiles((stepDetail as RequestParam).body, [], [], []).uploadFileIds, }); parseRequestBodyFiles((stepDetail as RequestParam).body, [], [], [], newFileRes); } else { diff --git a/frontend/src/views/api-test/scenario/components/step/useStepOperation.ts b/frontend/src/views/api-test/scenario/components/step/useStepOperation.ts index 548ec3ea2b..502fb5beaf 100644 --- a/frontend/src/views/api-test/scenario/components/step/useStepOperation.ts +++ b/frontend/src/views/api-test/scenario/components/step/useStepOperation.ts @@ -74,7 +74,7 @@ export default function useStepOperation({ stepType: step.stepType, refType: step.refType, isTempFile: false, // 复制未保存的步骤时 true - fileIds: Object.values(parseRequestBodyFiles((res as RequestParam).body, [], [], [])).flat(), + fileIds: parseRequestBodyFiles((res as RequestParam).body, [], [], []).uploadFileIds, }); parseRequestBodyFiles(res.body, [], [], [], newFileRes); } else {