订单接口最小化与私有文件访问加固
- 订单列表使用独立最小 DTO 并分页,号主待办提供独立接口与统计 - 用户 token 增加版本控制,冻结/改密/退出即时撤销会话 - 移除 URL token 传参,SSE 与接口统一使用 HttpOnly Cookie - 私有文件按上传归属与业务关联授权,收款凭证转私有访问并校验归属 - 公开商品接口返回最小字段,隐藏号主身份与内部状态 - 每日清理超过 30 天未关联业务的上传归属,上传归属失败时补偿删除对象
This commit is contained in:
@@ -34,6 +34,32 @@ export interface Listing {
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
// 公开商品卡片的最小字段,对应后端 PublicListingListItemDTO。
|
||||
export interface PublicListingItem {
|
||||
id: number
|
||||
listing_no: string
|
||||
title: string
|
||||
game_name: string
|
||||
server_region: string
|
||||
login_platform: string
|
||||
rank_level: string
|
||||
haf_coin_amount: number
|
||||
asset_summary?: Record<string, unknown>
|
||||
screenshot_urls?: string[]
|
||||
cover_url: string
|
||||
price_cent: number
|
||||
deposit_amount_cent: number
|
||||
is_accelerated_sale?: boolean
|
||||
published_at?: string
|
||||
created_at: string
|
||||
}
|
||||
|
||||
// 公开商品详情,对应后端 PublicListingDetailDTO。
|
||||
export interface PublicListingDetail extends PublicListingItem {
|
||||
description: string
|
||||
screenshot_urls: string[]
|
||||
}
|
||||
|
||||
export interface ListingPayload {
|
||||
title: string
|
||||
description: string
|
||||
@@ -85,7 +111,7 @@ export interface PublicListingQuery {
|
||||
}
|
||||
|
||||
export interface PublicListingPage {
|
||||
items: Listing[]
|
||||
items: PublicListingItem[]
|
||||
total: number
|
||||
page: number
|
||||
page_size: number
|
||||
@@ -126,7 +152,7 @@ function normalizePublicListingPage(
|
||||
}
|
||||
|
||||
export async function fetchListing(id: string | number) {
|
||||
const { data } = await apiClient.get<ApiResponse<Listing>>(`/listings/${id}`)
|
||||
const { data } = await apiClient.get<ApiResponse<PublicListingDetail>>(`/listings/${id}`)
|
||||
return data.data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user