From 795ab1c3348abb7b6fb2507a5587542e5689b839 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 10 Nov 2026 15:50:55 +0800 Subject: [PATCH] fix: chat user quota --- .../users/quota-settings/QuotaSettingsDialog.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/views/system/chat-management/users/quota-settings/QuotaSettingsDialog.vue b/ui/src/views/system/chat-management/users/quota-settings/QuotaSettingsDialog.vue index 44aa874bec3..b45f7fa367a 100644 --- a/ui/src/views/system/chat-management/users/quota-settings/QuotaSettingsDialog.vue +++ b/ui/src/views/system/chat-management/users/quota-settings/QuotaSettingsDialog.vue @@ -48,7 +48,8 @@ function buildPayload(): ChatUserQuotaPayload { quota_type: QUOTA_TYPE.PERIODIC, period_type: quotaSettingsForm.periodType, period_value: quotaSettingsForm.periodValue, - token_limit: quotaSettingsForm.tokenLimit, + // 前端单位是 K,传给后端时为原始 token 数 + token_limit: quotaSettingsForm.tokenLimit * 1000, } } @@ -85,7 +86,7 @@ async function loadQuota(userId: string) { quotaType: quota.quota_type, periodType: quota.period_type ?? PERIOD_TYPE.MONTH, periodValue: quota.period_value ?? 1, - tokenLimit: quota.token_limit ?? 10_000_000, + tokenLimit: quota.token_limit == null ? 10_000_000 : Math.round(quota.token_limit / 1000), }) } catch { // 请求层已提示错误;保留默认表单,用户可自行设置后再保存