fix: 接口测试转性能测试报错

This commit is contained in:
chenjianxing 2021-02-01 20:22:15 +08:00
parent acc2a27d69
commit 0f67b6fc9f
1 changed files with 16 additions and 14 deletions

View File

@ -322,21 +322,23 @@ export function _getBodyUploadFiles(request, bodyUploadFiles, obj) {
body = request.body; body = request.body;
} }
if (body) { if (body) {
body.kvs.forEach(param => { if (body.kvs) {
if (param.files) { body.kvs.forEach(param => {
param.files.forEach(item => { if (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); }
} });
}); }
}
});
if (body.binary) { if (body.binary) {
body.binary.forEach(param => { body.binary.forEach(param => {
if (param.files) { if (param.files) {