fix 修复bug
This commit is contained in:
@@ -17,7 +17,18 @@
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
const enabled = Boolean(vip.vip_enabled);
|
||||
const hasActiveSubscription = Number(vip.cycle_started_at || 0) > 0 && Number(vip.cycle_expires_at || 0) > now;
|
||||
setText(enabled && hasActiveSubscription ? "当前模型模式:平台模型" : "当前模型模式:自由模型");
|
||||
const activeModel = data.active_ai_model || {};
|
||||
const hasSelfModel =
|
||||
Boolean(String(activeModel.api_key || "").trim()) &&
|
||||
Boolean(String(activeModel.model || "").trim());
|
||||
const hasTrialCredits = Number(vip.total_available_credits || 0) > 0;
|
||||
if (enabled && hasActiveSubscription) {
|
||||
setText("当前模型模式:平台模型");
|
||||
} else if (enabled && !hasSelfModel && hasTrialCredits) {
|
||||
setText("当前模型模式:平台模型(体验版)");
|
||||
} else {
|
||||
setText("当前模型模式:自由模型");
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user