From e32988f6635fea3c5122c4628eb16daa76564e30 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Wed, 11 Oct 2023 00:04:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E8=A7=A3=E5=86=B3=20account=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index dca2be54..6f29c440 100644 --- a/src/App.vue +++ b/src/App.vue @@ -106,7 +106,7 @@ async function checkUserLoad(): Promise { await new Promise((resolve) => { setTimeout(() => { showSnackbar({ - text: "请先登录!", + text: "获取 Cookie 失败!请重新登录!", color: "error", timeout: 3000, }); @@ -127,6 +127,22 @@ async function checkUserLoad(): Promise { } else { console.info("briefInfo 数据已加载!"); } + const accountLocal = userStore.getCurAccount(); + const accountDB = await TGSqlite.getCurAccount(); + if (accountDB === false) { + showSnackbar({ + text: "获取 GameAccount 失败!请尝试更新数据库!", + color: "error", + timeout: 3000, + }); + return; + } + if (accountDB !== accountLocal) { + userStore.setCurAccount(accountDB); + console.info("curAccount 数据已更新!"); + } else { + console.info("curAccount 数据已加载!"); + } } // 创建数据文件夹 @@ -152,6 +168,7 @@ async function initData(): Promise { async function getDeepLink(): Promise { await event.listen("active_deep_link", (e) => { + console.log(e.payload); new TauriWindow.WebviewWindow("TeyvatGuide") .center() .then(async () => {