【小程序】小程序post方式后台拿不到data内部对象的值?
Page({
data: {
time: '获取验证码',//倒计时currentTime: 61,
data: {
"mobileAccount": "17611227293",
"codeType": "1"
}
},
getVerificationCode: function () {
this.getcode();var that = this;
that.setData({
disabled: true
})
},
getcode: function () {
var that = this;var currentTime = that.data.currentTime;
var sign = utilMd5.getSignMessage(app.globalData.signeed.partner, app.globalData.signeed.app_key , that.data.data);
var data = that.data.data
console.log(data)
wx.request({
url: 'http://api.xnyzc.com/api/user/sendCodeNew.do',
method: 'POST',
data: {
partner: "1000000",
data:{
"mobileAccount": "17611227293",
"codeType": "1"
}
sign
},
header: {
'content-type': 'application/x-www-form-urlencoded',
},
success: function (res) {
console.log(res)
},
fail: function (res) {
console.log(res)
}
})
发送请求之后,验签成功,后台拿不到data的值
后台结果是这样的
data里面是object Object
我应该怎么处理呢?
回答
把data转成字符串:
data:{ partner:...,
data:JSON.stringify({
mobileAccount:...
}),
...
}
以上是 【小程序】小程序post方式后台拿不到data内部对象的值? 的全部内容, 来源链接: utcz.com/a/80263.html