diff --git a/web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue b/web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue index c07e3a17..ed2d8ec1 100644 --- a/web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue +++ b/web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue @@ -557,11 +557,13 @@ const createApiKey = async () => { } // 模型限制 + data.enableModelRestriction = form.enableModelRestriction if (form.enableModelRestriction && form.restrictedModels.length > 0) { data.restrictedModels = form.restrictedModels } // 客户端限制 + data.enableClientRestriction = form.enableClientRestriction if (form.enableClientRestriction && form.allowedClients.length > 0) { data.allowedClients = form.allowedClients } @@ -570,7 +572,7 @@ const createApiKey = async () => { if (result.success) { showToast('API Key 创建成功', 'success') - emit('success', result.apiKey) + emit('success', result.data) emit('close') } else { showToast(result.message || '创建失败', 'error') diff --git a/web/admin-spa/src/components/apikeys/EditApiKeyModal.vue b/web/admin-spa/src/components/apikeys/EditApiKeyModal.vue index 8c84fc0a..3f41b3dd 100644 --- a/web/admin-spa/src/components/apikeys/EditApiKeyModal.vue +++ b/web/admin-spa/src/components/apikeys/EditApiKeyModal.vue @@ -447,6 +447,7 @@ const updateApiKey = async () => { } // 模型限制 + data.enableModelRestriction = form.enableModelRestriction if (form.enableModelRestriction && form.restrictedModels.length > 0) { data.restrictedModels = form.restrictedModels } else { @@ -454,6 +455,7 @@ const updateApiKey = async () => { } // 客户端限制 + data.enableClientRestriction = form.enableClientRestriction if (form.enableClientRestriction && form.allowedClients.length > 0) { data.allowedClients = form.allowedClients } else { diff --git a/web/admin-spa/src/views/ApiKeysView.vue b/web/admin-spa/src/views/ApiKeysView.vue index d688f30a..2bfef1c3 100644 --- a/web/admin-spa/src/views/ApiKeysView.vue +++ b/web/admin-spa/src/views/ApiKeysView.vue @@ -463,7 +463,7 @@