v3.5.4版本提交,修改api
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-08-21 16:22:53 +08:00
parent a01217539c
commit 62e61a9e63
21 changed files with 594 additions and 142 deletions
@@ -12,7 +12,7 @@ import {
mapSkuDto,
mapSpecAttrsDto,
pickDisplaySku,
resolveOrderSku,
resolveOrderSale,
} from './product-sku.util';
export type CatalogViewer = {
@@ -204,7 +204,7 @@ export class CatalogService {
});
}
/** 下单前校验:白名单商品仅全局测试白名单手机号可买;返回 SPU + 解析后的 SKU */
/** 下单前校验:白名单商品仅全局测试白名单手机号可买; SKU 时回落 SPU 字段 */
async assertPurchasable(
productId: bigint,
viewerPhone?: string | null,
@@ -224,8 +224,8 @@ export class CatalogService {
throw new BadRequestException('该商品暂不对当前账号开放');
}
}
const sku = resolveOrderSku(product.skus, skuId);
return { product, sku };
const sale = resolveOrderSale(product, product.skus ?? [], skuId);
return { product, sale };
}
async resolveUserPhone(userId: bigint): Promise<string | null> {