From 647e48cc844a79e32570c7043c9686f66367e04a Mon Sep 17 00:00:00 2001 From: ZhuiGuangAI Dev Date: Sat, 3 Oct 2026 11:30:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ai.zhuig.com=20=E6=A0=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/middleware.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/middleware.ts b/src/middleware.ts index a099114..f757e18 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -5,6 +5,12 @@ export default withAuth( function middleware(req) { const token = req.nextauth.token; const path = req.nextUrl.pathname; + const host = req.headers.get("host") || ""; + + // ai.zhuig.com 根路径 → 重定向到 /admin + if (host.startsWith("ai.zhuig.com") && path === "/") { + return NextResponse.redirect(new URL("/admin", req.url)); + } // 行业情报(/community)暂不对外开放:需登录后访问 if (path.startsWith("/community")) { @@ -77,5 +83,5 @@ export default withAuth( ); export const config = { - matcher: ["/admin/:path*", "/api/user/:path*", "/api/admin/:path*", "/community/:path*", "/api/community/:path*"], + matcher: ["/", "/admin/:path*", "/api/user/:path*", "/api/admin/:path*", "/community/:path*", "/api/community/:path*"], };