From 0bda26854395d11df2fbe2217e43000c5577aedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Wed, 9 Jul 2025 11:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BF=A1=E4=BB=A3=E7=A0=81=E5=BA=93-A?= =?UTF-8?q?I=E5=A4=A7=E6=A8=A1=E5=9E=8B=E7=8C=9C=E4=BD=A0=E6=83=B3?= =?UTF-8?q?=E9=97=AE=E5=B1=95=E7=A4=BA=E6=95=88=E6=9E=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Jyh/AI/Home/index.vue | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/views/Jyh/AI/Home/index.vue b/src/views/Jyh/AI/Home/index.vue index 3c79897..8bf9d43 100644 --- a/src/views/Jyh/AI/Home/index.vue +++ b/src/views/Jyh/AI/Home/index.vue @@ -245,6 +245,7 @@ const onInputIconClick = (e) => { }; const onSubmit = async (e, answer = undefined) => { + debugger let obj = { role: 'user', avatarPosition: 'side-right', @@ -252,9 +253,11 @@ const onSubmit = async (e, answer = undefined) => { if(e === '') { return; } - if (e?.sql) { + if (e?.question) { obj.content = e.question - obj.sql = e.sql + if(e?.sql) { + obj.sql = e.sql + } } else { obj.content = e } @@ -354,9 +357,11 @@ const getAIAnswer = async (content) => { loading: true, question: content } - if (content.sql) { + if (content?.question) { obj.question = content.question - obj.sql = content.sql + if(content?.sql) { + obj.sql = content.sql + } } else { obj.question = content } @@ -518,10 +523,14 @@ const fetchFollowupQuestions = async (question,df_id,sql_id='') => { df_id: df_id || '', // 使用当前会话ID,若无则为空 sql_id: sql_id || '' // 同上 }; - if (question?.sql) { + + if (question?.question) { params.question = question.question - params.sql = question?.sql || '' + if(question?.sql) { + params.sql = question?.sql || '' + } } + // const response = await axios.post( // `${VITE_AI_API_HOST}/api/v0/provide_followup_questions`, // params