fix: 前端报错

This commit is contained in:
chenjianxing 2020-12-08 12:02:12 +08:00
parent 91d37ccafe
commit d24c9c43b2
3 changed files with 47 additions and 36 deletions

View File

@ -263,13 +263,20 @@
<artifactId>spring-boot-starter-data-ldap</artifactId>
</dependency>
<!-- swagger 解析 -->
<!-- swagger2 解析 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-parser</artifactId>
<version>1.0.51</version>
</dependency>
<!-- swagger3 解析 -->
<!--<dependency>-->
<!--<groupId>io.swagger.parser.v3</groupId>-->
<!--<artifactId>swagger-parser</artifactId>-->
<!--<version>2.0.24</version>-->
<!--</dependency>-->
<!-- 执行 js 代码依赖 -->
<dependency>
<groupId>org.graalvm.sdk</groupId>

View File

@ -336,7 +336,7 @@
let bodyUploadFiles = [];
row.bodyUploadIds = [];
let request = row.request;
if (request.body) {
if (request.body && request.body.kvs) {
request.body.kvs.forEach(param => {
if (param.files) {
param.files.forEach(item => {
@ -350,19 +350,21 @@
});
}
});
request.body.binary.forEach(param => {
if (param.files) {
param.files.forEach(item => {
if (item.file) {
let fileId = getUUID().substring(0, 8);
item.name = item.file.name;
item.id = fileId;
row.bodyUploadIds.push(fileId);
bodyUploadFiles.push(item.file);
}
});
}
});
if (request.body.binary) {
request.body.binary.forEach(param => {
if (param.files) {
param.files.forEach(item => {
if (item.file) {
let fileId = getUUID().substring(0, 8);
item.name = item.file.name;
item.id = fileId;
row.bodyUploadIds.push(fileId);
bodyUploadFiles.push(item.file);
}
});
}
});
}
}
return bodyUploadFiles;
},

View File

@ -58,25 +58,10 @@
getBodyUploadFiles(obj) {
let bodyUploadFiles = [];
obj.bodyUploadIds = [];
this.runData.forEach(request => {
if (request.body) {
request.body.kvs.forEach(param => {
if (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);
}
});
}
});
if (request.body.binary) {
request.body.binary.forEach(param => {
if (this.runData) {
this.runData.forEach(request => {
if (request.body) {
request.body.kvs.forEach(param => {
if (param.files) {
param.files.forEach(item => {
if (item.file) {
@ -91,9 +76,26 @@
});
}
});
if (request.body.binary) {
request.body.binary.forEach(param => {
if (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);
}
});
}
});
}
}
}
});
});
}
return bodyUploadFiles;
},
run() {