wx.chooseImage({
success (res) {
const tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://www.music.eshutc.com/zuyu-online/aiServiceOrder/uploadFile', //真实的接口地址
filePath: tempFilePaths[0],
name: 'file',
formData: {
'folderName': 'complain',
'suffix':'.jpg'
},
success (res){
const data = res.data
//do something
}
})
}
})
name: "MultipartFile"就可以了
你自己定义的 name 为 file,所以接口接收参数为file