feat:添加管理员登录

This commit is contained in:
2026-05-09 11:16:00 +08:00
parent 56951c0383
commit cda7824eb2
19 changed files with 484 additions and 44 deletions

View File

@@ -1,9 +1,14 @@
import { AdminShell } from "@/components/admin/admin-shell";
import { AdminShellAuthGate } from "@/components/admin/admin-shell-auth-gate";
export default function AdminShellLayout({
children,
}: {
children: React.ReactNode;
}) {
return <AdminShell>{children}</AdminShell>;
return (
<AdminShellAuthGate>
<AdminShell>{children}</AdminShell>
</AdminShellAuthGate>
);
}

View File

@@ -1,5 +1,5 @@
import { ModuleScaffold } from "@/components/admin/module-scaffold";
import { getAdminPing } from "@/lib/admin-http";
import { getAdminPing } from "@/api";
import { dashboardModuleMeta } from "@/modules/dashboard/meta";
import type { Metadata } from "next";

View File

@@ -1,32 +1,12 @@
import Link from "next/link";
import { authModuleMeta } from "@/modules/auth/meta";
import type { Metadata } from "next";
import { AdminLoginForm } from "@/components/admin/admin-login-form";
import { authModuleMeta } from "@/modules/auth/meta";
export const metadata: Metadata = {
title: authModuleMeta.title,
};
export default function AdminLoginPage() {
return (
<div className="flex min-h-full flex-1 flex-col items-center justify-center px-4 py-16">
<div className="w-full max-w-md rounded-2xl border border-black/10 bg-white p-8 shadow-sm dark:border-white/10 dark:bg-zinc-900">
<h1 className="text-xl font-semibold text-foreground">
{authModuleMeta.title}
</h1>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-400">
{authModuleMeta.description}
</p>
<p className="mt-6 text-sm text-zinc-500 dark:text-zinc-400">
</p>
<Link
href="/admin"
className="mt-8 inline-flex text-sm font-medium text-foreground underline-offset-4 hover:underline"
>
</Link>
</div>
</div>
);
return <AdminLoginForm />;
}