微信小程序
index.js
onLoad: function (options)
{
this.test()
}
async test() {
await app.onLogin()
await this.onGetDefaultTime()
//请问为什么没有等 onLogin()执行完
}
---------------------------------------------
app.js
async onLogin() {
await wx.cloud.callFunction({
name: 'login',
data: {},
success: async (res) => {
console.warn("ID:" + res.result.openid)
this.data.openid = res.result.openid
},
})
}
谢谢!