feat: ai.zhuig.com 根路径重定向到后台管理

This commit is contained in:
ZhuiGuangAI Dev
2026-10-03 11:30:05 +08:00
parent 781b9b6c3a
commit 647e48cc84
+7 -1
View File
@@ -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*"],
};