https://www.jianshu.com/p/8429a174727d
post 请求
host:port/bindExpandCollection?nodeId=xxx&collectionId=xxx
postman接口测试没有问题。
发布到测试,前端调用出现问题?
解决方式是
前端把请求头中的’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)
}
})