feat(project): init

This commit is contained in:
zhangheng
2026-04-25 11:26:33 +08:00
commit 9bf212f67c
63 changed files with 11141 additions and 0 deletions

25
app/admin/page.tsx Normal file
View File

@@ -0,0 +1,25 @@
import NavigationShell from "@/components/navigation-shell";
import AdminDashboard from "@/components/admin-dashboard";
import { requireAdminUser, toPublicUser } from "@/lib/auth";
import { getAdminSnapshot } from "@/lib/admin";
export default async function AdminPage() {
const user = await requireAdminUser();
const publicUser = toPublicUser(user);
const snapshot = getAdminSnapshot();
if (!publicUser) {
throw new Error("Unable to resolve admin user.");
}
return (
<NavigationShell
currentUser={publicUser}
activePath="/admin"
title="管理后台"
description="配置用户角色与额度规则,让管理员无限额、普通用户受控。"
>
<AdminDashboard initialSnapshot={snapshot} />
</NavigationShell>
);
}