chore(catalog): 清理 LEWAN_ 列表过滤与商品图 UUID 历史回退

商品列表不再过滤镜像 SKU;图片只按英文 SKU 解析,修正 DLC 预设文案。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yml2213
2026-09-14 20:33:42 +08:00
co-authored by Cursor
parent c2d8228512
commit 6dc2375a79
4 changed files with 11 additions and 23 deletions
+2 -2
View File
@@ -879,9 +879,9 @@ export default function PlatformProducts() {
<Form.Item
name="dlc_good_id"
label="第一平台 (DLC) GoodID (选填)"
extra="留空将按系统内置预设映射自动选择(例如 yg_60_points 对应 1936306173007360000)"
extra="留空则使用系统内置「英文 SKU → DLC GoodID」预设;有乐玩商品请另填乐玩 UUID"
>
<Input placeholder="留空使用预设映射,或手动指定数字ID" allowClear />
<Input placeholder="留空使用内置 DLC 映射,或手动指定上游商品 ID" allowClear />
</Form.Item>
</Col>
</Row>
+2 -8
View File
@@ -7,7 +7,7 @@
export type ProductImageInput = {
sku?: string | null
/** 上游缩略图 URL(乐玩/DLC);仅在无本地 SKU 图时作回退 */
/** 上游缩略图 URL(乐玩/DLC);仅在无本地 SKU 图时作 image-proxy 回退 */
url?: string | null
}
@@ -25,8 +25,7 @@ export function resolveProductImageBySku(sku?: string | null): string {
/**
* 解析展示用商品图:
* 1. 有 sku → `/images/products/{sku}.webp`
* 2. 否则从 url 提取乐玩 UUID → `/images/products/{uuid}.webp`(历史缓存)
* 3. 其它外链 → image-proxy(运行时落盘到 data/uploads/products,仅兜底)
* 2. 其它外链 → image-proxy(运行时落盘到 data/uploads/products,仅兜底)
*/
export function resolveProductImage(input?: string | ProductImageInput | null): string {
if (input == null) return ''
@@ -47,10 +46,5 @@ export function resolveProductImage(input?: string | ProductImageInput | null):
if (!url) return ''
if (url.startsWith('/')) return url
const uuidMatch = url.match(/\/products\/([a-zA-Z0-9-]+)(?:\/|\.|$)/)
if (uuidMatch?.[1]) {
return `/images/products/${uuidMatch[1]}.webp`
}
return `/api/delivery/v1/image-proxy?url=${encodeURIComponent(url)}`
}