视频复刻积分规则优化

This commit is contained in:
Azmat@qq.com
2026-09-04 17:51:16 +08:00
parent 15718a60bf
commit ee3ddb49b4
8 changed files with 132 additions and 21 deletions
@@ -78,6 +78,17 @@ export function pointsPerImageFromCatalog(config: ModelConfig | undefined): numb
return Number.isFinite(unit) && unit > 0 ? unit : null;
}
/** 文本/视觉次价:优先挂牌 points_per_call,否则 unit_price。 */
export function pointsPerCallFromCatalog(config: ModelConfig | undefined): number | null {
const pricing = (config?.metadata?.points_pricing || {}) as Record<string, unknown>;
if (pricing.points_per_call != null) {
const n = Number(pricing.points_per_call);
return Number.isFinite(n) ? n : null;
}
const unit = Number(config?.unit_price);
return Number.isFinite(unit) && unit > 0 ? unit : null;
}
export const MODE_LABELS: Record<FreeMode, string> = { universal: "全能参考", keyframe: "首尾帧" };
// 上传素材限制(与后端 FreeVideoUploadView / jimeng inputBar 对齐)