From e05f45e6811eb8d11d00ee04fef6578acaca9e81 Mon Sep 17 00:00:00 2001 From: madrays <87717138@qq.com> Date: Thu, 20 Nov 2025 19:01:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E5=8F=AF=E7=94=A8ai=E6=A8=A1=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=98=93=E7=94=A8=E6=80=A7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/AccountSettingSystem.vue | 48 ++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/src/views/setting/AccountSettingSystem.vue b/src/views/setting/AccountSettingSystem.vue index 8f59195a..debc4a2f 100644 --- a/src/views/setting/AccountSettingSystem.vue +++ b/src/views/setting/AccountSettingSystem.vue @@ -119,6 +119,10 @@ const progressDialog = ref(false) // 高级设置对话框 const advancedDialog = ref(false) +// LLM 模型列表 +const llmModels = ref([]) +const loadingModels = ref(false) + const activeTab = ref('system') // 元数据语言 @@ -154,6 +158,32 @@ const logLevelItems = [ // 安全域名添加变量 const newSecurityDomain = ref('') +// 加载LLM模型列表 +async function loadLlmModels() { + loadingModels.value = true + try { + const result: { [key: string]: any } = await api.get('system/llm-models', { + params: { + provider: SystemSettings.value.Basic.LLM_PROVIDER, + api_key: SystemSettings.value.Basic.LLM_API_KEY, + base_url: SystemSettings.value.Basic.LLM_BASE_URL, + }, + }) + + if (result.success) { + llmModels.value = result.data + if (llmModels.value.length > 0) + SystemSettings.value.Basic.LLM_MODEL = llmModels.value[0] + } + else { + $toast.error(result.message) + } + } catch (error) { + console.log(error) + } + loadingModels.value = false +} + // 添加安全域名 function addSecurityDomain() { if ( @@ -637,14 +667,26 @@ onDeactivated(() => { /> - + > + +