import { Outlet, useLocation } from 'react-router-dom'; import { Navbar } from './Navbar'; import { Sidebar } from './Sidebar'; import { useUIStore } from '@stores/uiStore'; /** * 控制台布局 Shell * 固定侧栏、顶部导航栏、主工作区、移动端抽屉 */ export function Layout() { const { sidebarOpen, setSidebarOpen } = useUIStore(); const location = useLocation(); const legacy = !/^\/(market\/?|auth\/reset\/?)?$/.test(location.pathname); return (
{/* 顶部导航栏 */}
{/* 侧边栏:桌面端固定,移动端抽屉 */}
{/* 移动端遮罩层 */} {sidebarOpen && (
setSidebarOpen(false)} aria-hidden="true" /> )} {/* 主内容区域 */}
{legacy &&
Legacy 兼容入口:此处管理旧 Python 插件,不属于 DSH 原生市场。新云端部署默认不提供旧管理 API。
}
); }