From 6d40e4d65fd73ed3c17eacce13d42f70a9ac890d Mon Sep 17 00:00:00 2001 From: chengqian Date: Thu, 14 May 2026 11:45:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(playground):=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E5=88=B0=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/tenant/src/views/service/playground/ChatTab.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/tenant/src/views/service/playground/ChatTab.vue b/web/tenant/src/views/service/playground/ChatTab.vue index 448c96d..ba0a664 100644 --- a/web/tenant/src/views/service/playground/ChatTab.vue +++ b/web/tenant/src/views/service/playground/ChatTab.vue @@ -81,7 +81,7 @@ async function sendMessage() { } try { - const res = await request.post('/tenant/playground/chat', requestBody) + const res = await request.post('/tenant/playground/chat', requestBody, { _suppressErrorMsg: true } as any) if (res.data?.code === 0) { const data = res.data.data messages.value.push({ role: 'assistant', content: data.content || '(无响应内容)' }) @@ -90,9 +90,9 @@ async function sendMessage() { tokenUsage.total = data.total_tokens || 0 tokenUsage.cost = data.estimated_cost || '' } - } catch (e) { - console.error(e) - messages.value.push({ role: 'assistant', content: '请求失败,请重试' }) + } catch (e: any) { + const errMsg = e?.message || '请求失败,请重试' + messages.value.push({ role: 'assistant', content: errMsg }) } finally { sending.value = false await nextTick()