wx.uploadFile预览到手机上传不了图片,电脑就可以
for (var i = 0; i < ren.length; i++) {
const uploadTask = wx.uploadFile({
url: ‘http://www.xc001.net/chongwusys/simage’,
filePath: ren[i],
name: ‘image’,
header: {
“Content-Type”: “multipart/form-data”
},
formData: {
userId: 1,
index: i
},
success: function (res) {
console.log(res)
}
})
uploadTask.onProgressUpdate((res) => {
that.setData({
wode: res.progress
})
console.log(‘上传进度’, res.progress)
})