From ecf9902907dcea55799a39fa68867b3131beb9d2 Mon Sep 17 00:00:00 2001 From: Gsh <15170702455@163.com> Date: Sat, 14 Feb 2026 23:34:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4apik?= =?UTF-8?q?ey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/TokenFormDialog.vue | 65 +++++++++++-------- Yi.Ai.Vue3/src/pages/modelLibrary/index.vue | 2 +- 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue index df3999a7..45234f6b 100644 --- a/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue +++ b/Yi.Ai.Vue3/src/components/userPersonalCenter/components/TokenFormDialog.vue @@ -2,6 +2,23 @@ import { ElMessage } from 'element-plus'; import { computed, onMounted, onUnmounted, ref, watch } from 'vue'; +const props = withDefaults(defineProps(), { + visible: false, + mode: 'create', + formData: () => ({ + name: '', + expireTime: '', + premiumQuotaLimit: 0, + quotaUnit: '万', + }), +}); + +const emit = defineEmits<{ + 'update:visible': [value: boolean]; + 'confirm': [data: TokenFormData | TokenFormData[]]; + 'batchCreate': [items: TokenFormData[], onProgress: (index: number, status: CreateStatus, error?: string) => void]; +}>(); + // 最大批量创建数量 const MAX_BATCH_CREATE_COUNT = 10; @@ -29,23 +46,6 @@ interface Props { formData?: TokenFormData; } -const props = withDefaults(defineProps(), { - visible: false, - mode: 'create', - formData: () => ({ - name: '', - expireTime: '', - premiumQuotaLimit: 0, - quotaUnit: '万', - }), -}); - -const emit = defineEmits<{ - 'update:visible': [value: boolean]; - 'confirm': [data: TokenFormData | TokenFormData[]]; - 'batchCreate': [items: TokenFormData[], onProgress: (index: number, status: CreateStatus, error?: string) => void]; -}>(); - const localFormData = ref({ name: '', expireTime: '', @@ -119,7 +119,8 @@ watch(batchCount, (count) => { } batchNamesText.value = names.join('\n'); } - } else { + } + else { batchNamesText.value = ''; } }); @@ -373,7 +374,8 @@ async function handlePreviewConfirm() { // 预览对话框取消 function handlePreviewCancel() { - if (isCreating.value) return; + if (isCreating.value) + return; showPreviewDialog.value = false; previewNames.value = []; createStatusList.value = []; @@ -612,9 +614,15 @@ function formatDateTime(dateStr: string | null | undefined) {
- - - + + + + + + + + + @@ -662,7 +670,9 @@ function formatDateTime(dateStr: string | null | undefined) {
-
配额设置
+
+ 配额设置 +
无限制 @@ -677,7 +687,9 @@ function formatDateTime(dateStr: string | null | undefined) {
-
API 密钥名称列表
+
+ API 密钥名称列表 +
{ {{ model.modelTypeName }} - {{ item.modelApiTypeName }} + API类型: {{ item.modelApiTypeName }}