使用wx.reques获取网站内容使用setData不能对数据赋值?

发布于 8 年前作者 ghe5419 次浏览最后编辑 8 年前来自 issues

jlchassis: function() {

var _this = this;

wx.request({

url: 'https://localhost:44360/home/index',

header: {

'Content-Type': 'application/json'

},

success: function(e1) {

console.log(e1.data)

_this.setData({

start_address: e1.data

})

}

})

}

用console.log(start_address)显示未定义

1 回复
yan32
yan321 楼6 年前

e1.data是有数据的我用console.log(e1.data)可以看到数据