update
This commit is contained in:
@ -60,6 +60,22 @@ export interface ArticlePage {
|
||||
preview?: boolean // 未登录且总量超预览上限时为 true,前端据此弹登录门禁
|
||||
}
|
||||
|
||||
// 后端单张图片(与 PublicArticleImage 对齐):主图或细节图。
|
||||
export interface RawArticleImage {
|
||||
id?: string // 图片自身编码串(i/j 前缀),单图收藏用
|
||||
image: string // 该接口场景的主用地址(详情=展示样式 !style:high;列表=缩略图 !style:thumb)
|
||||
thumb?: string // 缩略图地址(!style:thumb),仅详情接口返回:供大图灯箱左栏缩略图条 / 右下角细节缩略图等小尺寸场景用,省带宽
|
||||
name?: string
|
||||
is_detail?: number // 0=主图 1=细节图(详情接口 images 仅含主图;细节在 details 分组)
|
||||
look_index?: number // 细节图归属的主图序号(与 images 主图的 look_index 一致)
|
||||
}
|
||||
|
||||
// 某个主图(look)对应的细节图集合(与 RunwayLookDetails 对齐),详情页「细节入口」按需展开。
|
||||
export interface RawLookDetails {
|
||||
look_index: number // 主图序号
|
||||
images: RawArticleImage[] // 该主图的细节图列表
|
||||
}
|
||||
|
||||
// 后端文章原始结构(与 PublicArticle / PublicArticleDetail 对齐)。
|
||||
export type RawArticle = {
|
||||
id: string | number // 后端为 hashid 编码串(string)
|
||||
@ -68,8 +84,11 @@ export type RawArticle = {
|
||||
cover: string
|
||||
brand_name: string
|
||||
brand_id?: string | number // hashid 编码串
|
||||
image_count?: number // 列表卡片 "N+" 角标用(仅列表接口返回)
|
||||
images?: { id?: string; image: string; name?: string }[] // id 为图片自身的编码串(i/j 前缀),单图收藏用
|
||||
image_count?: number // 列表卡片 "N+" 角标用(仅列表接口返回);改造后仅计主图数
|
||||
// 详情接口 images 仅含主图(look 图),默认展示;细节图在 details 分组,需经「细节入口」展开。
|
||||
images?: RawArticleImage[]
|
||||
// 按主图分组的细节图(「细节入口」展开用);无细节时为空数组或不返回。
|
||||
details?: RawLookDetails[]
|
||||
}
|
||||
|
||||
export interface AuthUser {
|
||||
@ -95,7 +114,6 @@ export interface SsgPopularBrand {
|
||||
|
||||
// 仅本模块内部使用(toAbs / request 等),不对外导出。
|
||||
function getBase(): string {
|
||||
// if (import.meta.env.DEV) return "https://seo.23cm.cn"
|
||||
// 运行期/预渲染统一走 BASE_API(空则同源相对 /api)
|
||||
return (BASE_API || "").replace(/\/$/, "")
|
||||
}
|
||||
@ -487,6 +505,9 @@ export interface HistoryMeta {
|
||||
cover: string
|
||||
brand: string
|
||||
type: "street" | "runway"
|
||||
// 后端回传的**规范 id**(带类型前缀,如 r0008CZYI)。历史/收藏里可能存在早期无前缀的 id,
|
||||
// 后端对无前缀串也能解析并回传规范 id,故用它做「同一篇文章」的判据与链接目标。
|
||||
id: string
|
||||
}
|
||||
|
||||
// 单篇回查:按编码串首字符判断类型(s 开头 = 街拍,其余 = 走秀)。失败返回 null,由调用方容忍。
|
||||
@ -507,6 +528,7 @@ export async function getHistoryMeta(id: string): Promise<HistoryMeta | null> {
|
||||
cover: (d.cover || "").toString(),
|
||||
brand: (d.brand_name || d.brand || "").toString(),
|
||||
type,
|
||||
id: (d.id || sid).toString(),
|
||||
}
|
||||
} catch {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user