mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-02 08:06:38 +08:00
fix debug
This commit is contained in:
parent
5b3c7822af
commit
1436e8df26
@ -3,8 +3,8 @@ import { Metadata } from "next";
|
|||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
import { AntdRegistry } from "@ant-design/nextjs-registry";
|
import { AntdRegistry } from "@ant-design/nextjs-registry";
|
||||||
// import Head from "next/head";
|
// import Head from "next/head";
|
||||||
import { VerifiedAdminUser, VerifiedUser } from "@/lib/auth";
|
// import { VerifiedAdminUser, VerifiedUser } from "@/lib/auth";
|
||||||
import { redirect } from "next/navigation";
|
// import { redirect } from "next/navigation";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Admin | 管理页面",
|
title: "Admin | 管理页面",
|
||||||
@ -15,10 +15,10 @@ export default async function AdminLayout({
|
|||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const isAdmin = await VerifiedAdminUser();
|
// const isAdmin = await VerifiedAdminUser();
|
||||||
if (!isAdmin) {
|
// if (!isAdmin) {
|
||||||
redirect("/");
|
// redirect("/");
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import "@/app/app/login.scss";
|
import "@/app/app/login.scss";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
import { VerifiedUser } from "@/lib/auth";
|
// import { VerifiedUser } from "@/lib/auth";
|
||||||
import { redirect } from "next/navigation";
|
// import { redirect } from "next/navigation";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Login | 实人认证",
|
title: "Login | 实人认证",
|
||||||
@ -13,11 +13,11 @@ export default async function AuthLayout({
|
|||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const isUser = await VerifiedUser();
|
// const isUser = await VerifiedUser();
|
||||||
if (isUser) {
|
// if (isUser) {
|
||||||
// Replace '/dashboard' with the desired redirect path
|
// // Replace '/dashboard' with the desired redirect path
|
||||||
redirect("/");
|
// redirect("/");
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container1 w-full signin">
|
<div className="container1 w-full signin">
|
||||||
|
12
app/page.tsx
12
app/page.tsx
@ -4,16 +4,16 @@ import { Home } from "./components/home";
|
|||||||
|
|
||||||
import { getServerSideConfig } from "./config/server";
|
import { getServerSideConfig } from "./config/server";
|
||||||
|
|
||||||
import { VerifiedUser } from "@/lib/auth";
|
// import { VerifiedUser } from "@/lib/auth";
|
||||||
import { redirect } from "next/navigation";
|
// import { redirect } from "next/navigation";
|
||||||
|
|
||||||
const serverConfig = getServerSideConfig();
|
const serverConfig = getServerSideConfig();
|
||||||
|
|
||||||
export default async function App() {
|
export default async function App() {
|
||||||
const isUser = await VerifiedUser();
|
// const isUser = await VerifiedUser();
|
||||||
if (!isUser) {
|
// if (!isUser) {
|
||||||
redirect("/login");
|
// redirect("/login");
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -9,7 +9,7 @@ datasource db {
|
|||||||
|
|
||||||
generator client {
|
generator client {
|
||||||
provider = "prisma-client-js"
|
provider = "prisma-client-js"
|
||||||
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
|
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "linux-musl-arm64-openssl-3.0.x"]
|
||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
|
Loading…
Reference in New Issue
Block a user