mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 15:46:39 +08:00
test loading
This commit is contained in:
parent
fc1768134c
commit
19d7ac5862
@ -1,5 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useSession } from "next-auth/react";
|
||||
|
||||
require("../polyfill");
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
@ -192,6 +194,7 @@ export function useLoadData() {
|
||||
}
|
||||
|
||||
export function Home() {
|
||||
// const { status } = useSession({ required: true })
|
||||
useSwitchTheme();
|
||||
useLoadData();
|
||||
useHtmlLang();
|
||||
|
@ -15,6 +15,11 @@ export default async function middleware(req: NextRequest) {
|
||||
return NextResponse.redirect(new URL(path.replace('/app', ''), req.url), 301);
|
||||
}
|
||||
|
||||
// 如果是主页,交给主页判断,这里判断会影响性能
|
||||
// if (path == "/") {
|
||||
// return NextResponse.next()
|
||||
// }
|
||||
|
||||
const session = await getToken({ req });
|
||||
const isUser = await VerifiedUser(session);
|
||||
const isAdminUser = await VerifiedAdminUser(session);
|
||||
@ -33,6 +38,8 @@ export default async function middleware(req: NextRequest) {
|
||||
return NextResponse.redirect(new URL("/", req.url))
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (path == '/login') {
|
||||
return NextResponse.rewrite(
|
||||
new URL(`/app${path}`, req.url),
|
||||
|
Loading…
Reference in New Issue
Block a user