Skip to content

Commit 849aa73

Browse files
committed
feat(front): 集成候补名单API、Demo页面和SEO优化
- 新增 `/api/waitlist` 服务端路由,将用户邮件持久化至本地 JSON 文件 - 在 CtaSection 中实现表单 loading、success、error 三态反馈 - 新增 `/demo` 页面,通过静态数据可视化展示种子→果实的完整流程 - 完善 SEO meta 标签,添加 og-image.svg、robots.txt 和 sitemap.xml - 优化移动端体验:减少粒子数量、调整表格布局、修复迭代树显示
1 parent a060ad6 commit 849aa73

44 files changed

Lines changed: 1978 additions & 264 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content-forest-front/.nuxt/dev/index.mjs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import nodeCrypto from 'node:crypto';
55
import { parentPort, threadId } from 'node:worker_threads';
66
import { defineEventHandler, handleCacheHeaders, splitCookiesString, createEvent, fetchWithEvent, isEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, getRequestHeader, setResponseHeaders, setResponseStatus, send, getRequestHeaders, setResponseHeader, appendResponseHeader, getRequestURL, getResponseHeader, removeResponseHeader, createError, getQuery as getQuery$1, readBody, createApp, createRouter as createRouter$1, toNodeListener, lazyEventHandler, getResponseStatus, getRouterParam, getResponseStatusText } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/h3/dist/index.mjs';
77
import { escapeHtml } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/@vue/shared/dist/shared.cjs.js';
8+
import { promises, readFileSync, writeFileSync } from 'node:fs';
89
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/vue-bundle-renderer/dist/runtime.mjs';
910
import { parseURL, withoutBase, joinURL, getQuery, withQuery, withTrailingSlash, decodePath, withLeadingSlash, withoutTrailingSlash, joinRelativeURL } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/ufo/dist/index.mjs';
1011
import { renderToString } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/vue/server-renderer/index.mjs';
@@ -32,7 +33,6 @@ import { AsyncLocalStorage } from 'node:async_hooks';
3233
import { getContext } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/unctx/dist/index.mjs';
3334
import { captureRawStackTrace, parseRawStackTrace } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/errx/dist/index.js';
3435
import _wH6JrtIxmaSoA8lCPWFnE9z4lQeXW6H5z3l5aymEQw from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/@nuxt/vite-builder/dist/fix-stacktrace.mjs';
35-
import { promises } from 'node:fs';
3636
import { fileURLToPath } from 'node:url';
3737
import { dirname as dirname$1, resolve as resolve$1 } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/pathe/dist/index.mjs';
3838
import { walkResolver } from 'file://D:/Code/Project/Github/ContentForest/content-forest-front/node_modules/unhead/dist/utils.mjs';
@@ -2591,10 +2591,12 @@ async function getIslandContext(event) {
25912591
};
25922592
}
25932593

2594+
const _lazy_yH2PCJ = () => Promise.resolve().then(function () { return waitlist_post$1; });
25942595
const _lazy_YXzf4B = () => Promise.resolve().then(function () { return renderer; });
25952596

25962597
const handlers = [
25972598
{ route: '', handler: _v_EJsZ, lazy: false, middleware: true, method: undefined },
2599+
{ route: '/api/waitlist', handler: _lazy_yH2PCJ, lazy: true, middleware: false, method: "post" },
25982600
{ route: '/__nuxt_error', handler: _lazy_YXzf4B, lazy: true, middleware: false, method: undefined },
25992601
{ route: '/__nuxt_island/**', handler: handler$1, lazy: false, middleware: false, method: undefined },
26002602
{ route: '/**', handler: _lazy_YXzf4B, lazy: true, middleware: false, method: undefined }
@@ -2937,6 +2939,36 @@ const styles$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
29372939
default: styles
29382940
}, Symbol.toStringTag, { value: 'Module' }));
29392941

2942+
const DATA_PATH = resolve("./server/data/waitlist.json");
2943+
function isValidEmail(email) {
2944+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
2945+
}
2946+
const waitlist_post = defineEventHandler(async (event) => {
2947+
var _a;
2948+
const body = await readBody(event);
2949+
const email = ((_a = body == null ? void 0 : body.email) != null ? _a : "").trim().toLowerCase();
2950+
if (!email || !isValidEmail(email)) {
2951+
return { success: false, message: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740" };
2952+
}
2953+
let list = [];
2954+
try {
2955+
list = JSON.parse(readFileSync(DATA_PATH, "utf-8"));
2956+
} catch {
2957+
list = [];
2958+
}
2959+
if (list.some((item) => item.email === email)) {
2960+
return { success: true, message: "\u4F60\u5DF2\u7ECF\u5728\u5019\u8865\u540D\u5355\u4E2D\u4E86" };
2961+
}
2962+
list.push({ email, joinedAt: (/* @__PURE__ */ new Date()).toISOString() });
2963+
writeFileSync(DATA_PATH, JSON.stringify(list, null, 2), "utf-8");
2964+
return { success: true, message: "\u5DF2\u6210\u529F\u52A0\u5165\u5019\u8865\u540D\u5355" };
2965+
});
2966+
2967+
const waitlist_post$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2968+
__proto__: null,
2969+
default: waitlist_post
2970+
}, Symbol.toStringTag, { value: 'Module' }));
2971+
29402972
function renderPayloadResponse(ssrContext) {
29412973
return {
29422974
body: encodeForwardSlashes(stringify(splitPayload(ssrContext).payload, ssrContext["~payloadReducers"])) ,

content-forest-front/.nuxt/dev/index.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"id":"dev","timestamp":1773588357897}
1+
{"id":"dev","timestamp":1773593801331}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"id":"dev","timestamp":1773588357897,"prerendered":[]}
1+
{"id":"dev","timestamp":1773593801331,"prerendered":[]}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Generated by nuxt-site-config
2+
3+
declare module 'nitropack' {
4+
interface NitroRouteRules {
5+
site?: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfigInput
6+
}
7+
interface NitroRouteConfig {
8+
site?: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfig
9+
}
10+
interface NitroRuntimeHooks {
11+
'site-config:init': (ctx: import('../../node_modules/nuxt-site-config/dist/runtime/types').HookSiteConfigInitContext) => void | Promise<void>
12+
}
13+
}
14+
15+
declare module 'h3' {
16+
interface H3EventContext {
17+
siteConfig: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfigStack
18+
siteConfigNitroOrigin: string
19+
}
20+
}
21+
22+
23+
declare module '@nuxt/schema' {
24+
interface Nuxt {
25+
_siteConfig?: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfigStack
26+
}
27+
}
28+
declare module 'nuxt/app' {
29+
interface NuxtApp {
30+
$nuxtSiteConfig: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfigStack
31+
}
32+
}
33+
declare module '#app' {
34+
interface NuxtApp {
35+
$nuxtSiteConfig: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfigStack
36+
}
37+
}
38+
39+
40+
declare global {
41+
interface Window {
42+
__NUXT_SITE_CONFIG__: import('../../node_modules/nuxt-site-config/dist/runtime/types').SiteConfigResolved
43+
}
44+
}
45+
46+
export {}

content-forest-front/.nuxt/nitro.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"date": "2026-03-15T15:26:02.705Z",
2+
"date": "2026-03-15T16:56:45.068Z",
33
"preset": "nitro-dev",
44
"framework": {
55
"name": "nuxt",
@@ -11,7 +11,7 @@
1111
"dev": {
1212
"pid": 44720,
1313
"workerAddress": {
14-
"socketPath": "\\\\.\\pipe\\nitro-worker-44720-1-1-8911.sock"
14+
"socketPath": "\\\\.\\pipe\\nitro-worker-44720-3-3-7020.sock"
1515
}
1616
}
1717
}

content-forest-front/.nuxt/nuxt.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/// <reference types="@nuxtjs/tailwindcss" />
1+
/// <reference types="@nuxt/devtools" />
22
/// <reference types="@vueuse/nuxt" />
33
/// <reference types="@nuxt/telemetry" />
4-
/// <reference types="@nuxt/devtools" />
4+
/// <reference types="@nuxtjs/tailwindcss" />
55
/// <reference path="types/nitro-layouts.d.ts" />
66
/// <reference path="types/builder-env.d.ts" />
77
/// <reference types="nuxt" />

content-forest-front/.nuxt/tailwind/postcss.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 2026/3/15 23:31:03
1+
// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 2026/3/16 01:36:54
22
import "@nuxtjs/tailwindcss/config-ctx"
33
import configMerger from "@nuxtjs/tailwindcss/merger";
44

content-forest-front/.nuxt/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
"unplugin-vue-router/client": [
1717
"../node_modules/unplugin-vue-router/client"
1818
],
19-
"@nuxt/schema": [
20-
"../node_modules/@nuxt/schema"
21-
],
2219
"nuxt": [
2320
"../node_modules/nuxt"
2421
],

content-forest-front/.nuxt/tsconfig.server.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
"unplugin-vue-router/client": [
4545
"../node_modules/unplugin-vue-router/client"
4646
],
47-
"@nuxt/schema": [
48-
"../node_modules/@nuxt/schema"
49-
],
5047
"nuxt": [
5148
"../node_modules/nuxt"
5249
],

0 commit comments

Comments
 (0)