feat: 新增隐私政策页面,Footer增加链接

This commit is contained in:
2026-08-06 17:22:49 +08:00
parent f6ce630587
commit 6c8077477a
4 changed files with 52 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { fetchAPI } from "./api-client";
import type { SimpleContentPageDetail, WagtailListResponse } from "@/types/wagtail";
/**
* 根据 slug 获取通用富文本内容页(apps.core.SimpleContentPage),
* 用于隐私政策、服务条款等法务/说明类页面。
*/
export async function getSimpleContentPageBySlug(
slug: string,
): Promise<SimpleContentPageDetail | null> {
const res = await fetchAPI<WagtailListResponse<SimpleContentPageDetail>>(
`/api/v2/pages/?type=core.SimpleContentPage&slug=${encodeURIComponent(slug)}&fields=body&limit=1`,
{ tags: [`legal-page:${slug}`] },
);
return res.items[0] ?? null;
}