From 0c2d4d0b89786190f7eb86e7c58245f585d42375 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Fri, 15 Sep 2023 17:30:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=BA=94=E7=94=A8=E5=88=9D?= =?UTF-8?q?=E6=AC=A1=E5=8A=A0=E8=BD=BD=E4=B9=9F=E5=8A=A0=E8=BD=BD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=EF=BC=8C=E5=AE=8C=E5=96=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=20load=20#40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 10 ++++++++++ src/pages/common/Config.vue | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 4994252a..8e9e65a6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,6 +22,7 @@ import { useAppStore } from "./store/modules/app"; // utils import { getEmojis } from "./plugins/Mys/request/getEmojis"; import showSnackbar from "./components/func/snackbar"; +import TGSqlite from "./plugins/Sqlite"; const appStore = useAppStore(); const isMain = ref(false); @@ -76,6 +77,7 @@ async function checkLoad(): Promise { return; } await createDataDir(); + await initData(); appStore.loading = true; console.info("数据加载完成!"); } @@ -89,6 +91,14 @@ async function createDataDir(): Promise { } console.info("数据文件夹创建完成!"); } + +// 初始化数据库 +async function initData(): Promise { + await TGSqlite.reset(); + showSnackbar({ + text: "已成功初始化数据库!", + }); +}