UPDATE
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-22 01:51:42 +08:00
parent 975c55feb2
commit 0df14036cf
16 changed files with 270 additions and 1023 deletions

View File

@ -7,14 +7,14 @@
// - 客户端(浏览器运行期):走 PUBLIC_API_BASE,置空时同源相对 /api(由 nginx 反代到 backend)。
export interface BrandEntry {
id: number
id: string // 后端返回 hashid 编码串(非自增主键),防爬虫顺序枚举
name: string
article_count: number
}
export interface ArticleItem {
id: number
brand_id: number
id: string // hashid 编码串
brand_id: string // hashid 编码串
title: string
cover: string
brand_name: string
@ -31,7 +31,7 @@ export interface ArticleQuery {
page?: number
size?: number
sort?: string
brand_ids?: number[]
brand_ids?: string[] // 编码串数组,透传给后端解码
collection_type?: string[]
season?: string[]
year?: string[]
@ -83,7 +83,7 @@ export async function getBrands(opts?: {
if (opts?.letter) qs.set("letter", opts.letter)
const j = await request<{ data?: any[] }>("/public/brands", qs)
return (j.data ?? []).map((b: any) => ({
id: Number(b.id),
id: String(b.id),
name: (b.name || b.show_name || "").toString(),
article_count: Number(b.article_count ?? 0),
}))