import { existsSync } from "node:fs"; import path from "node:path"; import type { Metadata } from "next"; import { redirect } from "next/navigation"; import { auth } from "@/app/(auth)/auth"; const ZOO_MODELING_APP_SRC = "/vendor/zoo-modeling-app/index.html?v=f2b345db-eng1"; export const dynamic = "force-dynamic"; export const metadata: Metadata = { title: "HiCAD", }; export const runtime = "nodejs"; export default async function AiCadPage() { const session = await auth(); if (!session?.user?.id) { redirect("/login?callbackUrl=%2Fai-cad"); } const isReady = existsSync( path.join(process.cwd(), "public/vendor/zoo-modeling-app/index.html") ); if (isReady) { redirect(ZOO_MODELING_APP_SRC); } return (

HiCAD 官方前端尚未构建

请运行 pnpm zoo-modeling-app:vendor 生成官方前端,然后刷新本页。

); }