refactor(auth-files): split AuthFilesPage

This commit is contained in:
Supra4E8C
2026-02-14 00:11:41 +08:00
parent 03a1644df7
commit e13d7f5e0f
18 changed files with 2594 additions and 2062 deletions

View File

@@ -0,0 +1,30 @@
export type AuthFilesUiState = {
filter?: string;
search?: string;
page?: number;
pageSize?: number;
};
const AUTH_FILES_UI_STATE_KEY = 'authFilesPage.uiState';
export const readAuthFilesUiState = (): AuthFilesUiState | null => {
if (typeof window === 'undefined') return null;
try {
const raw = window.sessionStorage.getItem(AUTH_FILES_UI_STATE_KEY);
if (!raw) return null;
const parsed = JSON.parse(raw) as AuthFilesUiState;
return parsed && typeof parsed === 'object' ? parsed : null;
} catch {
return null;
}
};
export const writeAuthFilesUiState = (state: AuthFilesUiState) => {
if (typeof window === 'undefined') return;
try {
window.sessionStorage.setItem(AUTH_FILES_UI_STATE_KEY, JSON.stringify(state));
} catch {
// ignore
}
};