代码像下面一样,目的是为了检测数据库有没有这个用户,如果有就跳过这个环节
const db = wx.cloud.database()
db.collection('student').where({
_openid: app.globalData.openid
})
.get({
success: function(res) {
console.log(res.date.lenght)
if (parseFloat(res.date.lenght) > 0) {
wx.navigateTo({
url: '../index1/index1',
})
}
},
})
网友回复
肖达炫:
同问,楼主有没解决
金柯:
把console.log(res.date.lenght)改为console.log(res.data.length)