let base64 = wx.getFileSystemManager().readFileSync(url, 'base64')
uploadImg(data) {
uni.uploadFile({
header: {
sign: this.$store.getters.sign
},
formData: {
type: 'image/png'
},
fileType: 'image',
url: apiurl + this.url,
file: data,
name: 'imgBase64',
success: (uploadFileRes) => {
console.log(uploadFileRes,999)
// let data = JSON.parse(uploadFileRes.data)
// this.imageSrc = data.data;
// this.$load.close()
// this.showImg = false
this.$alertinfo('上传成功')
}
})
},
获取图片将图片转为base64上传,上传的api没有任何反应
0 个回复