fix(frontend): 移除缓存价格自动计算对 input_price > 0 的限制

当 input_price_per_1m 为 0 时,缓存价格(creation/read/1h)也应自动计算,
而非跳过赋值。
This commit is contained in:
fawney19
2026-02-22 15:26:40 +08:00
parent 1a45d0aa87
commit c43d22b0e4

View File

@@ -402,14 +402,14 @@ function getFinalTiers(): PricingTier[] {
// 缓存创建价格:手动设置则用设置值,否则自动计算
if (cacheManuallySet[i]?.creation && t.cache_creation_price_per_1m != null) {
tier.cache_creation_price_per_1m = t.cache_creation_price_per_1m
} else if (t.input_price_per_1m > 0) {
} else {
tier.cache_creation_price_per_1m = getAutoCacheCreation(i)
}
// 缓存读取价格:手动设置则用设置值,否则自动计算
if (cacheManuallySet[i]?.read && t.cache_read_price_per_1m != null) {
tier.cache_read_price_per_1m = t.cache_read_price_per_1m
} else if (t.input_price_per_1m > 0) {
} else {
tier.cache_read_price_per_1m = getAutoCacheRead(i)
}
@@ -417,7 +417,7 @@ function getFinalTiers(): PricingTier[] {
if (props.showCache1h) {
if (cacheManuallySet[i]?.cache1h && t.cache_ttl_pricing?.length) {
tier.cache_ttl_pricing = t.cache_ttl_pricing
} else if (t.input_price_per_1m > 0) {
} else {
tier.cache_ttl_pricing = [{ ttl_minutes: 60, cache_creation_price_per_1m: getAutoCache1h(i) }]
}
}