wip: 🚧 通知公告重构临时提交

This commit is contained in:
ray
2024-09-27 08:40:00 +08:00
parent 060fe452a2
commit b797acbb49
17 changed files with 340 additions and 367 deletions

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

@@ -0,0 +1,19 @@
const TOKEN_KEY = "v3-admin-token";
function getToken(): string {
return localStorage.getItem(TOKEN_KEY) || "";
}
function setToken(token: string) {
return localStorage.setItem(TOKEN_KEY, token);
}
function removeToken() {
return localStorage.removeItem(TOKEN_KEY);
}
function isLogin(): boolean {
return !!getToken();
}
export { getToken, setToken, removeToken, isLogin };