1.修复文件第二次上传会失败的问题 2. 2.0版本上传文件可自动读取文件名

This commit is contained in:
p71924506 2022-12-21 15:40:31 +08:00
parent 7cd9e4f2a4
commit 0cb087c4b6
1 changed files with 4 additions and 1 deletions

View File

@ -59,6 +59,7 @@
<el-upload
class="upload-demo"
drag
ref="fileUpload"
:headers="headers"
action="/api/file/uploadFile"
:on-success="uploadSuccess"
@ -350,11 +351,12 @@ export default {
},
//
uploadSuccess(response){
uploadSuccess(response, file, fileList){
if (response.status == 0) {
Message.success("上传成功")
//ID
this.filesInfo.location = response.url
this.filesInfo.name = file.name
}
},
@ -371,6 +373,7 @@ export default {
Message.success("上传成功")
this.handleClose()
this.selectByType()
this.$refs.fileUpload.clearFiles()
}
})
}else{