修复自动登出时锁屏缓存未清除

This commit is contained in:
lai
2024-01-12 18:35:53 +08:00
committed by simonzhangsz
parent ede252bfe0
commit 8ac3d9690e
2 changed files with 65 additions and 36 deletions

View File

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