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); }