From 6c8077477afd3f87e73537e105f0132acd829535 Mon Sep 17 00:00:00 2001 From: Zhengen TANG Date: Thu, 6 Aug 2026 17:22:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E9=9A=90=E7=A7=81?= =?UTF-8?q?=E6=94=BF=E7=AD=96=E9=A1=B5=E9=9D=A2=EF=BC=8CFooter=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/privacy-policy/page.tsx | 27 +++++++++++++++++++++++++++ components/layout/Footer.tsx | 5 +++++ services/legal.service.ts | 16 ++++++++++++++++ types/wagtail.ts | 4 ++++ 4 files changed, 52 insertions(+) create mode 100644 app/privacy-policy/page.tsx create mode 100644 services/legal.service.ts diff --git a/app/privacy-policy/page.tsx b/app/privacy-policy/page.tsx new file mode 100644 index 0000000..ba5925f --- /dev/null +++ b/app/privacy-policy/page.tsx @@ -0,0 +1,27 @@ +import { notFound } from "next/navigation"; +import type { Metadata } from "next"; +import { getSimpleContentPageBySlug } from "@/services/legal.service"; + +export async function generateMetadata(): Promise { + const page = await getSimpleContentPageBySlug("privacy-policy").catch(() => null); + return { title: page?.title ?? "隐私政策" }; +} + +export default async function PrivacyPolicyPage() { + const page = await getSimpleContentPageBySlug("privacy-policy").catch(() => null); + + if (!page) { + notFound(); + } + + return ( +
+

{page.title}

+ {/* page.body 为 Wagtail RichTextField 渲染出的 HTML,内容仅由后台编辑人员维护,非用户输入,可信任直接渲染 */} +
+
+ ); +} diff --git a/components/layout/Footer.tsx b/components/layout/Footer.tsx index 6c55541..481971d 100644 --- a/components/layout/Footer.tsx +++ b/components/layout/Footer.tsx @@ -3,6 +3,11 @@ export default function Footer() {