1.修复文件第二次上传会失败的问题 2. 2.0版本上传文件可自动读取文件名
This commit is contained in:
parent
7cd9e4f2a4
commit
0cb087c4b6
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue