[FIX]【保全】退保-图片上传修改

This commit is contained in:
yuweiqi
2020-06-13 12:46:44 +08:00
parent 9e0b469feb
commit 90df5f1d6b

View File

@@ -134,11 +134,15 @@ export default {
message: '加载中……'
})
let formdata = new FormData()
formdata.append('imgPath', this.dataURLtoFile(file.content, file.file.name))
let imgName = Math.floor(Math.random() * 100).toString() + new Date().getTime() + file.file.name //为图片名加随机数 与时间戳
formdata.append('imgPath', this.dataURLtoFile(file.content, imgName))
uploadImg(formdata).then(res => {
this.$toast.clear()
if (res.result == '0') {
this.uploadCheck.popList.push({ name: file.file.name, imgPath: res.path })
this.uploadCheck.popList.push({
name: file.file.name,
imgPath: res.path
})
console.log(this.fileList)
} else {
this.$toast(res.resultMessage)