优化黑白名单

This commit is contained in:
sijinhui
2024-01-23 13:42:10 +08:00
parent e98643c7c8
commit 7a8db39a2a
7 changed files with 98 additions and 89 deletions

View File

@@ -8,7 +8,8 @@ import {
// DatePicker,
} from "@tremor/react";
import UsageByModel from "./usage-by-model-chart";
import { getSession, ADMIN_LIST, isName } from "@/lib/auth";
import { getSession } from "@/lib/auth";
import { isName, ADMIN_LIST } from "@/lib/auth_list";
import { redirect } from "next/navigation";
export default async function AdminPage() {

View File

@@ -3,7 +3,8 @@ import { Metadata } from "next";
import { ReactNode } from "react";
// import { useEffect } from "react";
// import {useSession} from "next-auth/react";
import { getSession, isName } from "@/lib/auth";
import { getSession } from "@/lib/auth";
import { isName } from "@/lib/auth_list";
import { redirect } from "next/navigation";
export const metadata: Metadata = {

View File

@@ -2,7 +2,7 @@
import { signIn } from "next-auth/react";
import React, { useState, useEffect, useRef } from "react";
import { isName } from "@/lib/auth";
import { isName } from "@/lib/auth_list";
export default function UserLoginButton() {
const [loading, setLoading] = useState(false);

View File

@@ -4,7 +4,8 @@ import { Home } from "./components/home";
import { getServerSideConfig } from "./config/server";
import { getSession, isName } from "@/lib/auth";
import { getSession } from "@/lib/auth";
import { isName } from "@/lib/auth_list";
import { redirect } from "next/navigation";
const serverConfig = getServerSideConfig();