refactor: 存储优化

Former-commit-id: 6a051fac3c80be339c1eb01780e12334ad888551
This commit is contained in:
haoxr
2022-12-18 15:01:55 +08:00
parent 4f319bca19
commit 37e3935d97
4 changed files with 94 additions and 4 deletions

15
src/utils/auth.ts Normal file
View File

@@ -0,0 +1,15 @@
import Cookies from 'js-cookie';
const TokenKey = 'vue3-element-admin-token';
export function getToken() {
return Cookies.get(TokenKey);
}
export function setToken(token: string) {
Cookies.set(TokenKey, token);
}
export function removeToken() {
return Cookies.remove(TokenKey);
}