From 28de48b8a5c75613e050b24000c52eade8208b57 Mon Sep 17 00:00:00 2001 From: let5sne Date: Thu, 9 Jul 2026 23:29:44 +0800 Subject: [PATCH] fix(frontend): test selected model provider only --- frontend/src/views/system/model/index.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/system/model/index.vue b/frontend/src/views/system/model/index.vue index aa3d78c1..02de6d2d 100644 --- a/frontend/src/views/system/model/index.vue +++ b/frontend/src/views/system/model/index.vue @@ -571,11 +571,10 @@ const filteredProviders = computed(() => { const activeProvider = computed( () => providers.value.find((item) => item.providerCode === selectedProviderCode.value) ?? providers.value[0] ?? seedProviders[0] ); -const activeChatModel = computed( - () => - modelRows.value.find((item) => item.category === 'chat' && item.enabled && item.configured) ?? - modelRows.value.find((item) => item.category === 'chat' && item.enabled) ?? - modelRows.value[0] +const activeChatModel = computed(() => + modelRows.value.find( + (item) => item.id > 0 && item.providerCode === selectedProviderCode.value && item.category === 'chat' && item.enabled && item.configured + ) ); const keyText = computed(() => { if (!activeProvider.value.configured) return '未配置'; @@ -681,6 +680,10 @@ const runVectorRebuild = async () => { }; const runConnectionTest = async () => { + if (!activeChatModel.value) { + ElMessage.warning('请先为当前供应商配置并启用 chat 模型'); + return; + } testing.value = true; try { const result = await testModelChat({