wx.uploadFile预览到手机上传不了图片,电脑就可以
发布于 5 年前 作者 juan00 4256 次浏览 来自 问答

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)

})

回到顶部