<el-row style="padding-top:25px">
<el-form-item label="上传凭证:" prop="billAttachment" class="onlond">
<!-- financeAcceptanceBill -->
<el-upload
class="upload-demo"
:on-success="handleSuccess"
:on-change="upload"
:before-upload="berore"
drag
style="width:100%;padding-left:10px"
name="MultipartFile[]"
action="/api/systemAttachment/upload"
multiple
:headers="onheader"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text" style="width:100%;">
将文件拖到此处,或
<em>点击上传</em>
</div>
</el-upload>
</el-form-item>
</el-row>
data 里面定义一下
onheader: {
Authorization: 'Bearer ’ + getCookie(‘uToken’)
},
guid: ‘’,
fileList: [],
methods 里面
// 上传成功
handleSuccess (response, file, fileList) {
this.guid = response.obj[0].guid
},
upload (fileList) {
console.log(fileList)
},
berore (file, fileList) {
return true
},
图片