From 171f9da2eda743cb9a49d52c6a9eded7cec09d1b Mon Sep 17 00:00:00 2001 From: geniusay <969025903@qq.com> Date: Mon, 25 Aug 2025 01:22:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=8F=90=E7=A4=BA=E8=AF=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Chat/AIChatPage.vue | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/prompto-lab-ui/src/components/Chat/AIChatPage.vue b/prompto-lab-ui/src/components/Chat/AIChatPage.vue index 4056f79..7b8d8e5 100644 --- a/prompto-lab-ui/src/components/Chat/AIChatPage.vue +++ b/prompto-lab-ui/src/components/Chat/AIChatPage.vue @@ -912,20 +912,19 @@ const handleGeneratePrompt = async (answerData: any) => { updateActivity() try { - // 调用生成提示词API,传入sessionId和userId - const promptResult = await generatePrompt({ + // 调用生成提示词API,触发后端生成提示词 + // 注意:这里只是触发生成,真正的提示词内容会通过SSE消息返回 + await generatePrompt({ sessionId: session.value.sessionId, answer: answerData }) - // 通过ref获取QuestionRenderer组件实例并设置提示词结果 - if (questionRendererRef.value && questionRendererRef.value.setPromptResult) { - questionRendererRef.value.setPromptResult(promptResult) - } + // 不在这里设置提示词结果,等待SSE消息中的handleGenPromptMessage处理 + // 真正的提示词内容会通过SSE消息在handleGenPromptMessage中处理 - toast.success({ - title: '生成成功', - message: '提示词已生成完成', + toast.info({ + title: '生成中', + message: '正在生成提示词,请稍候...', duration: 2000 })