Initial commit: HealthCarePregnant project documentation and platform

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
selfrelease
2026-06-18 09:48:05 +08:00
commit eab91174db
301 changed files with 42491 additions and 0 deletions
@@ -0,0 +1,27 @@
import type { AuthUser } from '../api/types';
const KEY = 'pcm.family.session';
export interface Session {
token: string;
user: AuthUser;
/** 绑定的被照护孕妇档案 ID(家属受授权查看) */
boundPatientId: string | null;
}
export function loadSession(): Session | null {
try {
const raw = localStorage.getItem(KEY);
return raw ? (JSON.parse(raw) as Session) : null;
} catch {
return null;
}
}
export function saveSession(session: Session): void {
localStorage.setItem(KEY, JSON.stringify(session));
}
export function clearSession(): void {
localStorage.removeItem(KEY);
}