mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🐛 修复用户登录状态异常
This commit is contained in:
@@ -152,10 +152,12 @@ async function checkUserLoad(): Promise<void> {
|
||||
await mkdir(appStore.userDir, { recursive: true });
|
||||
// 检测用户数据
|
||||
const uidDB = await TSUserAccount.account.getAllUid();
|
||||
if (uidDB.length === 0) {
|
||||
if (uidDB.length === 0 && appStore.isLogin) {
|
||||
showSnackbar({ text: "未检测到可用UID,请重新登录!", color: "warn" });
|
||||
appStore.isLogin = false;
|
||||
return;
|
||||
}
|
||||
if (!appStore.isLogin) appStore.isLogin = true;
|
||||
// 然后获取最近的UID
|
||||
if (userStore.uid.value === undefined || !uidDB.includes(userStore.uid.value)) {
|
||||
userStore.uid.value = uidDB[0];
|
||||
|
||||
Reference in New Issue
Block a user