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