feat(web): add reusable admin form dialog

This commit is contained in:
2026-05-09 20:15:35 +08:00
parent c0335bd5d0
commit a5e66e79cd
49 changed files with 6013 additions and 1108 deletions
+23
View File
@@ -0,0 +1,23 @@
const AUTH_TOKEN_STORAGE_KEY = 'easyai_ai_gateway_access_token';
export function readStoredAccessToken() {
if (typeof window === 'undefined') return '';
try {
return window.localStorage.getItem(AUTH_TOKEN_STORAGE_KEY) ?? '';
} catch {
return '';
}
}
export function persistAccessToken(value: string) {
if (typeof window === 'undefined') return;
try {
if (value) {
window.localStorage.setItem(AUTH_TOKEN_STORAGE_KEY, value);
} else {
window.localStorage.removeItem(AUTH_TOKEN_STORAGE_KEY);
}
} catch {
// Ignore storage failures so private browsing or quota issues do not break login.
}
}