From c63ff848271df02e3137966145d62a1f0a68950a Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sun, 21 May 2023 18:56:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20ck=20?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home.vue | 4 ++++ src/store/modules/user.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/Home.vue b/src/pages/Home.vue index 5a6c0363..b271fc5a 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -12,11 +12,13 @@ import TPosition from "../components/t-position.vue"; import TCalendar from "../components/t-calendar.vue"; // store import { useHomeStore } from "../store/modules/home"; +import { useUserStore } from "../store/modules/user"; // utils import TGSqlite from "../utils/TGSqlite"; // store const homeStore = useHomeStore(); +const userStore = useUserStore(); // loading const loading = ref(true as boolean); @@ -42,6 +44,8 @@ function readLoading (): void { } onMounted(async () => { + const ck = await TGSqlite.getCookie(); + userStore.initCookie(ck); loadingTitle.value = "正在检测数据完整性"; const isOK = await TGSqlite.check(); if (!isOK) { diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 814ebdf8..3e9bd0ba 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -32,7 +32,7 @@ export const useUserStore = defineStore( return cookie.value[key] || ""; } - async function initCookie (ck: Record): Promise { + function initCookie (ck: Record): void { if (cookie.value !== ck) { cookie.value = ck; }