后台的json数据,无法调用具体数据
onLoad: function () {
var that = this
wx.request({
url: ‘http://127.0.0.1:8080/tmall/foreproduct?pid=1’,
header: {
‘content-type’: ‘application/json’
},
success: function (res) {
console.log(res.data) //这里成功打印出了数据
console.log(res.data.product) //这里打印显示undefined
},
fail: function (res) {
console.log(“fail”)
}
})
<ignore_js_op style=""> </ignore_js_op>
},