fix(接口测试): 文件上传删除文件失败

This commit is contained in:
chenjianxing 2020-10-20 13:46:19 +08:00
parent 1c9050d833
commit 6de79df31f
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@
handleRemove(file) { handleRemove(file) {
this.$refs.upload.handleRemove(file); this.$refs.upload.handleRemove(file);
for (let i = 0; i < this.parameter.files.length; i++) { for (let i = 0; i < this.parameter.files.length; i++) {
if (file.file.name === this.parameter.files[i].file.name) { let fileName = file.file ? file.file.name : file.name;
let paramFileName = this.parameter.files[i].file ?
this.parameter.files[i].file.name : this.parameter.files[i].name;
if (fileName === paramFileName) {
this.parameter.files.splice(i, 1); this.parameter.files.splice(i, 1);
this.$refs.upload.handleRemove(file); this.$refs.upload.handleRemove(file);
break; break;