fix: unify chinese language code as zh-CN

This commit is contained in:
TerryM
2026-05-26 10:03:12 +08:00
parent f2e97c329e
commit f482a2ec38
13 changed files with 53 additions and 50 deletions

View File

@@ -15,7 +15,7 @@ status: draft
- API base前端通过 `VITE_API_URL` 指向后端;本地可同源 `/api`
- 上传文件可通过 `/uploads/...` 或完整 URL 返回;前端会用 `assetUrl()` 处理相对路径。
- 所有时间字段使用 ISO 8601 字符串,例如 `2026-05-24T14:42:00.000Z`
- 语言字段:`zh` / `en` / `ja` / `ko` / `vi` / `id` / `ms`;默认语言为 `en`。中文只有简体 `zh`,没有繁体中文。
- 语言字段:`zh-CN` / `en` / `ja` / `ko` / `vi` / `id` / `ms`;默认语言为 `en`。中文只有简体 `zh-CN`,没有繁体中文。
- 错误格式:非 2xx + text/plain 或 JSON 均可;前端会显示错误文本。
- Admin 接口需要 `Authorization: Bearer <token>`
@@ -57,7 +57,7 @@ type Post = {
id: string;
categoryId: number;
categorySlug: string;
language: "zh" | "en" | "ja" | "ko" | "vi" | "id" | "ms";
language: "zh-CN" | "en" | "ja" | "ko" | "vi" | "id" | "ms";
text?: string;
attachments: Attachment[];
isRecommended: boolean;
@@ -449,7 +449,7 @@ Request:
```ts
type UpsertPostPayload = {
categoryId: number;
language: "zh" | "en" | "ja" | "ko" | "vi" | "id" | "ms";
language: "zh-CN" | "en" | "ja" | "ko" | "vi" | "id" | "ms";
text?: string;
attachments: Attachment[];
isPublic: boolean;