mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
🐛 解决 account 初始化问题
This commit is contained in:
19
src/App.vue
19
src/App.vue
@@ -106,7 +106,7 @@ async function checkUserLoad(): Promise<void> {
|
|||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showSnackbar({
|
showSnackbar({
|
||||||
text: "请先登录!",
|
text: "获取 Cookie 失败!请重新登录!",
|
||||||
color: "error",
|
color: "error",
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
});
|
});
|
||||||
@@ -127,6 +127,22 @@ async function checkUserLoad(): Promise<void> {
|
|||||||
} else {
|
} else {
|
||||||
console.info("briefInfo 数据已加载!");
|
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<void> {
|
|||||||
|
|
||||||
async function getDeepLink(): Promise<void> {
|
async function getDeepLink(): Promise<void> {
|
||||||
await event.listen("active_deep_link", (e) => {
|
await event.listen("active_deep_link", (e) => {
|
||||||
|
console.log(e.payload);
|
||||||
new TauriWindow.WebviewWindow("TeyvatGuide")
|
new TauriWindow.WebviewWindow("TeyvatGuide")
|
||||||
.center()
|
.center()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user