🎨 fix(db): 改进代码结构

This commit is contained in:
BTMuli
2023-04-25 16:08:35 +08:00
parent cc42d1fcb3
commit 35d9382643
13 changed files with 135 additions and 611 deletions

View File

@@ -12,6 +12,8 @@ import TPosition from "../components/t-position.vue";
import TCalendar from "../components/t-calendar.vue";
// store
import { useHomeStore } from "../store/modules/home";
// utils
import TGSqlite from "../utils/TGSqlite";
// store
const homeStore = useHomeStore();
@@ -40,6 +42,12 @@ function readLoading (): void {
}
onMounted(async () => {
loadingTitle.value = "正在检测数据完整性";
const isOK = await TGSqlite.check();
if (!isOK) {
loadingTitle.value = "正在修复数据";
await TGSqlite.reset();
}
loadingTitle.value = "正在加载首页";
const showItems = homeStore.getShowValue();
await Promise.allSettled(