数据绑定
发布于 6 年前 作者 wangping 6571 次浏览 来自 问答

this.setData({

url: wx.getStorageSync(‘xxx’),

news: req.wxRequest(‘xxx’, { token: wx.getStorageSync(‘token’) }).then(res => {

return res.data

}).catch(err => {

console.log(err)

})

}),

请问为什么拿不到服务器返回的值呢,

返回的是promise,怎么能拿到里面的data呢。


另外还有

logs: (wx.getStorageSync('logs') || []).map(log => {

return util.formatTime(new Date(log))

})

wx.getStorageSync('logs') || []

这个是什么语法呢?找不到教程啊。。。

回到顶部