后台 3D 定价校验不再因缺段或缺子表整页崩掉
- apps/admin-web/src/pages/adminEditorGenerationPricing.ts:提交前校验对 3D 端点段做存在性判断,缺段直接跳过该段
- apps/admin-web/src/pages/adminEditorGenerationPricing.ts:versionPrices / addOnPrices 取值补 `?? {}` 兜底,接口返回残缺时降级为「校验不出问题」,不再抛异常白屏
This commit is contained in:
@@ -67,9 +67,13 @@ export function collectInvalidEditorGenerationPricingLabels(
|
||||
const model3d = pricing.model3d;
|
||||
if (model3d) {
|
||||
for (const { key, label } of EDITOR_MODEL3D_ENDPOINT_SECTIONS) {
|
||||
// 段与子表都来自接口返回:缺段或缺子表时只跳过这一段,不能让整页校验崩掉。
|
||||
const endpointPricing = model3d[key];
|
||||
if (!endpointPricing) {
|
||||
continue;
|
||||
}
|
||||
for (const [version, price] of Object.entries(
|
||||
endpointPricing.versionPrices,
|
||||
endpointPricing.versionPrices ?? {},
|
||||
)) {
|
||||
if (!isPositiveMudPoints(price.noTexture)) {
|
||||
labels.push(`${label} ${version} 无贴图`);
|
||||
@@ -79,7 +83,7 @@ export function collectInvalidEditorGenerationPricingLabels(
|
||||
}
|
||||
}
|
||||
for (const [addOn, price] of Object.entries(
|
||||
endpointPricing.addOnPrices,
|
||||
endpointPricing.addOnPrices ?? {},
|
||||
)) {
|
||||
if (!isPositiveMudPoints(price)) {
|
||||
labels.push(`${label} ${editorModel3dAddOnLabel(addOn)}`);
|
||||
|
||||
Reference in New Issue
Block a user