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));
obj.resourceId = getUUID();
if (obj.name) {
obj.name = obj.name + '_copy';
obj.name = obj.name + '_copy';
}
hashTree.push(obj);
this.sort();
@ -817,21 +817,23 @@
}
})
// csv
this.currentScenario.variables.forEach(param => {
if (param.type === 'CSV' && param.files) {
param.files.forEach(item => {
if (item.file) {
if (!item.id) {
let fileId = getUUID().substring(0, 12);
item.name = item.file.name;
item.id = fileId;
if (this.currentScenario.variables) {
this.currentScenario.variables.forEach(param => {
if (param.type === 'CSV' && param.files) {
param.files.forEach(item => {
if (item.file) {
if (!item.id) {
let fileId = getUUID().substring(0, 12);
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;
},
editScenario(showMessage) {