// 登录后的应用外壳:顶栏(品牌 + 导航 + 当前用户 + 登出)+ 内容区 import { type ReactNode } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { clearSession, getProfile } from '../auth/token'; import { MOCK_PAGES } from '../api/schema'; export function AppLayout({ children }: { children: ReactNode }) { const navigate = useNavigate(); const profile = getProfile(); const logout = () => { clearSession(); navigate('/login', { replace: true }); }; return (
EIP4 渲染宿主 {profile ? `${profile.name}(${profile.account})` : '未登录'}
{children}
); }