refactor: 替换管理员登录组件并更新会话管理

This commit is contained in:
2026-05-09 13:48:11 +08:00
parent cda7824eb2
commit 9805f56d3a
15 changed files with 359 additions and 77 deletions

View File

@@ -1,21 +0,0 @@
const STORAGE_KEY = "lottery_admin_token";
export function readStoredAdminToken(): string | null {
if (typeof window === "undefined") {
return null;
}
const raw = window.localStorage.getItem(STORAGE_KEY)?.trim();
return raw && raw !== "" ? raw : null;
}
export function writeStoredAdminToken(token: string | null): void {
if (typeof window === "undefined") {
return;
}
if (token && token.trim() !== "") {
window.localStorage.setItem(STORAGE_KEY, token.trim());
} else {
window.localStorage.removeItem(STORAGE_KEY);
}
}