This commit is contained in:
Archer
2023-11-09 09:46:57 +08:00
committed by GitHub
parent 661ee79943
commit 8bb5588305
402 changed files with 9899 additions and 5967 deletions

View File

@@ -11,8 +11,10 @@ export const clearToken = () => {
};
export const setToken = (token: string) => {
if (typeof window === 'undefined') return '';
localStorage.setItem(tokenKey, token);
};
export const getToken = () => {
if (typeof window === 'undefined') return '';
return localStorage.getItem(tokenKey) || '';
};