fix bug edge runtime

This commit is contained in:
sijinhui
2024-04-07 11:14:04 +08:00
parent 847bf8928f
commit 94bc0fa732
4 changed files with 27 additions and 33 deletions

View File

@@ -3,12 +3,23 @@ import { Metadata } from "next";
import { ReactNode } from "react";
import { AntdRegistry } from "@ant-design/nextjs-registry";
// import Head from "next/head";
import { VerifiedAdminUser, VerifiedUser } from "@/lib/auth";
import { redirect } from "next/navigation";
export const metadata: Metadata = {
title: "Admin | 管理页面",
};
export default function AdminLayout({ children }: { children: ReactNode }) {
export default async function AdminLayout({
children,
}: {
children: ReactNode;
}) {
const isAdmin = await VerifiedAdminUser();
if (!isAdmin) {
redirect("/");
}
return (
<>
<AntdRegistry>