已经配置好了域名,wx.request能正确请求到,wx.uploadfile报域名不合法的错误。代码如下:
wx.chooseImage({
success: function(res) {
var tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'https://www.riskall.cn/fastapply/CustomerAction.do',
filePath: tempFilePaths[0],
name: 'photo',
formData:{
'method': 'createFastApply4MicroPic'
},
method:'POST',
header: { "Content-Type": "multipart/form-data" },
success: function(res){
var data = res.data
console.log(data);
//do something
}
})
}
})