后台定价校验:空 prices 不再跳过底价检查
- apps/admin-web/src/pages/adminEditorGenerationPricing.ts:分层计价分支改为仅当 prices 真的有档位时进入,`prices: {}` 不再让 modelPricing.price 逃过提交前校验
This commit is contained in:
@@ -51,8 +51,10 @@ export function collectInvalidEditorGenerationPricingLabels(
|
||||
) {
|
||||
const labels: string[] = [];
|
||||
for (const [model, modelPricing] of Object.entries(pricing.models)) {
|
||||
if (modelPricing.prices) {
|
||||
for (const [tier, price] of Object.entries(modelPricing.prices)) {
|
||||
const tieredPrices = modelPricing.prices;
|
||||
// `prices: {}` 没有档位可校验,不能算「这一项走分层计价」——否则底价会被顺手跳过校验。
|
||||
if (tieredPrices && Object.keys(tieredPrices).length > 0) {
|
||||
for (const [tier, price] of Object.entries(tieredPrices)) {
|
||||
if (!isPositiveMudPoints(price)) {
|
||||
labels.push(`${model} ${tier}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user