From 1bc010fb3751dd9ee112c3a41d1fb42c678b3c26 Mon Sep 17 00:00:00 2001 From: sijinhui Date: Sat, 10 Aug 2024 22:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E5=95=A5=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/ui-lib.tsx | 2 +- lib/auth.ts | 4 ++++ middleware.ts | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx index 1d087be6d..d8bef4c2f 100644 --- a/app/components/ui-lib.tsx +++ b/app/components/ui-lib.tsx @@ -599,7 +599,7 @@ export function ModalSelector(props: { onClose?: () => void; multiple?: boolean; }) { - console.log("-----", props); + // console.log("-----", props); const getCheckCardAvatar = (value: string): React.ReactNode => { if (value.startsWith("gpt")) { diff --git a/lib/auth.ts b/lib/auth.ts index 39dd5be54..d9d646ad8 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -183,6 +183,10 @@ export const authOptions: NextAuthOptions = { // console.log('---', user, 'account', account, 'email', email, 'exist', existingUser) // 顺便过滤掉不允许登录的用户 return !!existingUser && existingUser.allowToLogin; + }, + // 重定向 + async redirect({ url, baseUrl }) { + return baseUrl; } }, }; diff --git a/middleware.ts b/middleware.ts index 8b9e3b83d..1a8c7ff79 100644 --- a/middleware.ts +++ b/middleware.ts @@ -11,7 +11,6 @@ export default async function middleware(req: NextRequest) { const path = `${url.pathname}${ searchParams.length > 0 ? `?${searchParams}` : "" }`; - console.log('----', url) // 直接将/app/下面路由重定向到顶层 if (path.startsWith('/app')) { return NextResponse.redirect(new URL(path.replace('/app', ''), req.url), 301);