feat: 新增隐私政策页面,Footer增加链接
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user