fix: 旧版复制请求,文件上传参数同步修改问题
This commit is contained in:
parent
24e89b5b3c
commit
6b076416fb
|
@ -118,7 +118,21 @@ export default {
|
||||||
},
|
},
|
||||||
copyRequest(index) {
|
copyRequest(index) {
|
||||||
let request = this.scenario.requests[index];
|
let request = this.scenario.requests[index];
|
||||||
this.scenario.requests.push(new RequestFactory(request));
|
let item = new RequestFactory(request);
|
||||||
|
if (item.body && item.body.kvs) {
|
||||||
|
item.body.kvs.forEach(kv => {
|
||||||
|
let files = [];
|
||||||
|
if (kv.files) {
|
||||||
|
kv.files.forEach(file => {
|
||||||
|
let fileCopy = {};
|
||||||
|
Object.assign(fileCopy, file);
|
||||||
|
files.push(fileCopy);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
kv.files = files;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.scenario.requests.push(item);
|
||||||
},
|
},
|
||||||
disableRequest(index) {
|
disableRequest(index) {
|
||||||
this.scenario.requests[index].enable = false;
|
this.scenario.requests[index].enable = false;
|
||||||
|
|
Loading…
Reference in New Issue