fix(接口自动化): 解决无法创建场景问题

This commit is contained in:
fit2-zhao 2021-01-13 11:24:20 +08:00
parent 6f67e89a9d
commit 0230aba400
1 changed files with 17 additions and 15 deletions

View File

@ -665,7 +665,7 @@
let obj = JSON.parse(JSON.stringify(row)); let obj = JSON.parse(JSON.stringify(row));
obj.resourceId = getUUID(); obj.resourceId = getUUID();
if (obj.name) { if (obj.name) {
obj.name = obj.name + '_copy'; obj.name = obj.name + '_copy';
} }
hashTree.push(obj); hashTree.push(obj);
this.sort(); this.sort();
@ -817,21 +817,23 @@
} }
}) })
// csv // csv
this.currentScenario.variables.forEach(param => { if (this.currentScenario.variables) {
if (param.type === 'CSV' && param.files) { this.currentScenario.variables.forEach(param => {
param.files.forEach(item => { if (param.type === 'CSV' && param.files) {
if (item.file) { param.files.forEach(item => {
if (!item.id) { if (item.file) {
let fileId = getUUID().substring(0, 12); if (!item.id) {
item.name = item.file.name; let fileId = getUUID().substring(0, 12);
item.id = fileId; item.name = item.file.name;
item.id = fileId;
}
obj.bodyUploadIds.push(item.id);
bodyUploadFiles.push(item.file);
} }
obj.bodyUploadIds.push(item.id); })
bodyUploadFiles.push(item.file); }
} })
}) }
}
})
return bodyUploadFiles; return bodyUploadFiles;
}, },
editScenario(showMessage) { editScenario(showMessage) {