feat: Next.js 后端 + SQLite + 暗门后台 /virtheart + 服务咨询页
后端(node:sqlite 零原生依赖,data/site.db,WAL + busy_timeout 抗并发): - works / service_items / site_config / inquiries / admin_users / admin_sessions / captcha_challenges - API:admin 登录登出/密码、作品与服务 CRUD、图片上传、留言箱、 验证码 challenge/verify、咨询提交(一次性滑块令牌防重放) 后台 /virtheart(仅手动访问,未登录一律 307 → /virtheart/login): - 服务端布局鉴权 + DB 会话(httpOnly cookie 7 天)+ CSRF 头校验 - 概览 / 作品(上传、网格预设、发布开关)/ 服务 / 留言箱 / 配置(全站文案) - 设计与主站同语言:暗底点阵、mono、lime 选中,非传统后台模板 公开站: - 路由组 (site) 隔离站点壳层;首页/服务页文案全部 DB 驱动即时生效 - /services 服务菜单 + 留言表单 + 全屏居中滑块拼图验证码(对齐缺口) - 提交入 inquiries 并 SMTP(飞书 notify@)邮件通知 chenchun@virtheart.com - Header 新增「服务」菜单;旧作品清理,空状态自动接管 - 根布局仅承载字体/全局样式,后台无站点壳层 验证:登录/CSRF/发布隔离/滑块容错/令牌单次消费/SMTP 真发全部通过; lint 与基线一致(119 errors 均为存量)。
This commit is contained in:
+8
-32
@@ -1,16 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import localFont from "next/font/local";
|
||||
import "./globals.css";
|
||||
import SmoothScroller from "@/components/dom/SmoothScroller";
|
||||
import Header from "@/components/dom/Header";
|
||||
import BackgroundGrid from "@/components/dom/BackgroundGrid";
|
||||
import CustomScrollbar from "@/components/dom/CustomScrollbar";
|
||||
import LoadingOverlay from "@/components/dom/LoadingOverlay";
|
||||
import { HeroScene } from "@/components/canvas/HeroScene";
|
||||
import { PasscodeAccessProvider } from "@/components/dom/PasscodeAccess";
|
||||
import { FullscreenTransitionProvider } from "@/lib/routeTransition";
|
||||
import RouteTransitionOverlay from "@/components/dom/RouteTransitionOverlay";
|
||||
import { getPasscodeAccessServer } from "@/lib/passcodeServer";
|
||||
|
||||
const tiktokSans = localFont({
|
||||
src: "./fonts/TikTokSans.ttf",
|
||||
@@ -34,18 +24,21 @@ const departureMono = localFont({
|
||||
// 以 <link> 引入 —— 见下方 <head>;不进 next/font 管线(整包 5MB/字重)。
|
||||
|
||||
export const metadata: Metadata = {
|
||||
// Detail pages override the title via generateMetadata in
|
||||
// app/work/[slug]/layout.tsx (original: per-page title).
|
||||
// 站点标题/描述可在 /virtheart 后台「配置」中修改(site_config 表)。
|
||||
title: "北极新一©2026",
|
||||
description: "设计与工程 / 数字产品与 AI 应用 © 2026",
|
||||
};
|
||||
|
||||
export default async function RootLayout({
|
||||
/**
|
||||
* 根布局 — 仅承载 html/body/字体/全局样式。
|
||||
* 站点壳层(画布、Header、滚动)在 app/(site)/layout.tsx;
|
||||
* 后台 /virtheart 使用独立布局,不加载站点壳层。
|
||||
*/
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const initialAccess = await getPasscodeAccessServer();
|
||||
return (
|
||||
<html
|
||||
lang="zh-CN"
|
||||
@@ -85,24 +78,7 @@ export default async function RootLayout({
|
||||
suppressHydrationWarning
|
||||
/>
|
||||
</head>
|
||||
<body className="min-h-screen relative">
|
||||
<PasscodeAccessProvider initialAccess={initialAccess}>
|
||||
<FullscreenTransitionProvider>
|
||||
{/* Original stacking (1:1): the WebGL canvas host is a plain `fixed`
|
||||
z-auto element first in the body; the grid overlay (z-20) comes
|
||||
AFTER it in DOM order so it paints above the canvas, exactly like
|
||||
the original's main > canvas + z-20 grid sibling. */}
|
||||
<HeroScene />
|
||||
<BackgroundGrid />
|
||||
<SmoothScroller />
|
||||
<Header />
|
||||
{children}
|
||||
<CustomScrollbar />
|
||||
<RouteTransitionOverlay />
|
||||
<LoadingOverlay />
|
||||
</FullscreenTransitionProvider>
|
||||
</PasscodeAccessProvider>
|
||||
</body>
|
||||
<body className="min-h-screen relative">{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user