把请求头中的
'content-type': "application/json"
改为'content-type': "application/x-www-form-urlencoded"
即可。
错误写法
wx.request({
url: HttpUrl + '/user/wxxcx/denWxxcxPhoneByOpenid',
method: "post",
data: {
openid: "xxxxx",
},
header: {
'content-type': "application/json"
},
success (res) {
console.log(res.data.data)
}
})
正确写法
wx.request({
url: HttpUrl + '/user/wxxcx/denWxxcxPhoneByOpenid',
method: "post",
data: {
openid: "xxxxx",
},
header: {
'content-type': "application/x-www-form-urlencoded"
},
success (res) {
console.log(res.data.data)
}
})
网友评论