答案 0 :(得分:1)
试试这个:
async function checkLogin() {
const check = await new Promise(function (resolve) {
authDefault.onAuthStateChanged(function (user) {
if (user) {
resolve(1);
}
else {
resolve(2);
}
});
});
return check;
}