From 277497420c2d299928b05aa5a7b3507831c9842f Mon Sep 17 00:00:00 2001 From: Megghy Date: Mon, 7 Apr 2025 00:15:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Cookie=20=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E7=B1=BB=E5=9E=8B=EF=BC=9B=E6=9B=B4=E6=96=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=9B=E6=B7=BB=E5=8A=A0=20Tauri=20=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=BB=A5=E6=94=AF=E6=8C=81=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/account.ts | 2 +- src/components/RegisterAndLogin.vue | 2 +- src/data/constants.ts | 2 + src/main.ts | 61 ++++++++++++++++------------- 4 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/api/account.ts b/src/api/account.ts index 69f61e3..44220aa 100644 --- a/src/api/account.ts +++ b/src/api/account.ts @@ -13,7 +13,7 @@ export const isLoggedIn = computed(() => { }); const { message } = createDiscreteApi(['message']); -export const cookie = useLocalStorage('Cookie', {cookie: '', refreshDate: 0}, { serializer: StorageSerializers.object }); +export const cookie = useLocalStorage<{ cookie: string; refreshDate: number }>('Cookie', {cookie: '', refreshDate: 0}, { serializer: StorageSerializers.object }); export async function GetSelfAccount(token?: string) { if (cookie.value.cookie || token) { diff --git a/src/components/RegisterAndLogin.vue b/src/components/RegisterAndLogin.vue index eac3cce..e859b78 100644 --- a/src/components/RegisterAndLogin.vue +++ b/src/components/RegisterAndLogin.vue @@ -218,7 +218,7 @@ onUnmounted(() => { -