From 0db2153dc934a568ef27e92fb165386d104a94d7 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Fri, 12 Jan 2024 18:35:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E7=99=BB?= =?UTF-8?q?=E5=87=BA=E6=97=B6=E9=94=81=E5=B1=8F=E7=BC=93=E5=AD=98=E6=9C=AA?= =?UTF-8?q?=E6=B8=85=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LockScreen/index.vue | 96 ++++++++++++++++++----------- src/plugins/auth-token.ts | 5 +- 2 files changed, 65 insertions(+), 36 deletions(-) diff --git a/src/components/LockScreen/index.vue b/src/components/LockScreen/index.vue index ad3336b0..55e24b2d 100644 --- a/src/components/LockScreen/index.vue +++ b/src/components/LockScreen/index.vue @@ -87,7 +87,6 @@ onUnmounted(() => { if (timeoutId) { clearTimeout(timeoutId); } - localRemove(CACHE_LOCAL_LOCK); }); + + diff --git a/src/plugins/auth-token.ts b/src/plugins/auth-token.ts index 2c5bd953..438d46bd 100644 --- a/src/plugins/auth-token.ts +++ b/src/plugins/auth-token.ts @@ -1,5 +1,7 @@ import Cookies from 'js-cookie'; import { TOKEN_COOKIE } from '@/constants/token-constants'; +import { localRemove } from '@/utils/cache-local-utils'; +import { CACHE_LOCAL_LOCK } from '@/constants/cache-keys-constants'; /**获取cookis中Token字符串 */ export function getToken(): string { @@ -11,7 +13,8 @@ export function setToken(token: string): void { Cookies.set(TOKEN_COOKIE, token); } -/**移除cookis中Token字符串 */ +/**移除cookis中Token字符串,localStorage中锁屏字符串 */ export function removeToken(): void { Cookies.remove(TOKEN_COOKIE); + localRemove(CACHE_LOCAL_LOCK); }