老师我试了,还是取不出formData,只能娶到filePath,就是官方实例中 user: ‘test’,怎么在后台取出来
wx.chooseImage({
success(res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'file',
formData: {
user: 'test'
},
success(res) {
const data = res.data
// do something
}
})
}
})