把后台 token、Ant 主题、壳层控件和抽屉弹窗从用户工作台拆开,去掉树状侧栏装饰线,色板仍用原来的中性黑白台阶。 Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
872 B
TypeScript
29 lines
872 B
TypeScript
import { useUserStore } from "@/stores/use-user-store";
|
||
import { AdminProvider } from "./admin-context";
|
||
import { AdminShell } from "./components/admin-shell";
|
||
import "./theme/admin-tokens.css";
|
||
import "./theme/admin-chrome.css";
|
||
|
||
export default function AdminPage() {
|
||
const actor = useUserStore((state) => state.user);
|
||
const hydrated = useUserStore((state) => state.hydrated);
|
||
|
||
if (!hydrated) return null;
|
||
if (actor?.role !== "admin") {
|
||
return (
|
||
<main data-admin-root className="admin-unauthorized">
|
||
<div className="admin-unauthorized-card">
|
||
<h1>无权限</h1>
|
||
<p>当前账号不是管理员,无法访问后台。</p>
|
||
</div>
|
||
</main>
|
||
);
|
||
}
|
||
|
||
return (
|
||
<AdminProvider>
|
||
<AdminShell />
|
||
</AdminProvider>
|
||
);
|
||
}
|