我的上传代码很简单,
wx.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album'],
success: (res) => {
wx.showToast({
icon: "loading",
title: "正在上传",
duration: 10000
})
const tempFilePath = res.tempFilePaths[0]
new AV.File(app.globalData.user.nickName + this.data.images.length, {
blob: {
uri: tempFilePath,
},
}).save().then(file => {xxx}).catch(console.error)
}
})