`<el-form-item class="upload-m clearfix" prop="certificatePhoto">
<el-upload
ref="upload"
:http-request="upload"
:file-list="fileList"
list-type="picture-card"
accept=".pdf"
action
>
<div class="upload-icon"></div>
<span class="upload" @click="current==index">点击上传</span>
</el-upload>
<div class="upload-imgList clearfix">
<div v-for="(fileItem,index) in fileList" :key="index" class="upload-img-list ml">

<span class="file-name slh">{{ fileItem.fileName }}</span>
<div class="operation">
<a>预览</a>
<span class="del" @click="del(index)">删除</span>
</div>
</div>
</div>
</el-form-item>`
请求
`async upload({ file }) {
try {
// 图片转换为2进制
const p = new FormData()
p.append('file', file)
const res = await pdfAndImgSelf(p)
this.$set(this.registerDirectorData[this.current], 'files', [{ name: file.name, value: res.data.data.url, imgurl: res.data.data.imgurl }])
} catch (e) {
this.$message.error('上传失败,请重新上传')
}
},`
目前上传成功后还是走catch 并且页面没有上传的图片
走catch 肯定是 try 模块里有报错了,可以先打印下catch 的 err 信息看看 err信息 ,或者 try 里面debugger 调试看看哪一步报错了 没有失败原因很难定位问题