bugfix: 输入内容会携带报告标签

This commit is contained in:
2026-03-10 16:28:11 +08:00
parent b997f10cfc
commit e934d77f95
4 changed files with 35 additions and 40 deletions

View File

@@ -24,10 +24,9 @@
import { ref, reactive, computed, onUnmounted, onMounted, nextTick, watch } from 'vue'
import List from './List.vue'
import Input from '../../components/Input.vue'
import { fetchAgentReply } from '@/api/agent'
import { chatUrl } from '@/api/agent'
import type { AgentParamsType } from '@/api/agent'
import { useUserInfoStore, useProjectStore } from '@/stores'
import { useAgentStore } from '@/stores/agent'
import { useUserInfoStore, useProjectStore, useAgentStore } from '@/stores'
const userStore = useUserInfoStore()
const agentStore = useAgentStore()
@@ -54,6 +53,8 @@
message: '',
token: userStore.state.token,
versionID: '',
needSuggestion: false,
useReport: false,
configParams: {
type: '',
region: '',
@@ -99,6 +100,8 @@
style: initialData.style,
temperature: 0.7
}
params.needSuggestion = initialData.needSuggestion || false
params.useReport = initialData.useReport
handleSendMessage({
text: initialData.text,
images: initialData.images,
@@ -158,7 +161,7 @@
configParams: JSON.stringify(params.configParams)
})
const BASEURL = import.meta.env.VITE_APP_URL
const response = await fetch(`${BASEURL}/api/ai-design/chat?${urlParams.toString()}`, {
const response = await fetch(`${BASEURL}${chatUrl}?${urlParams.toString()}`, {
method: 'GET',
signal: abortController.signal
})
@@ -221,7 +224,7 @@
}
buffer += decoder.decode(value, { stream: true })
// 优先按空行拆分事件块SSE标准
let events = buffer.split(/\n\n/)
buffer = events.pop() // 保留不完整块
@@ -469,11 +472,10 @@
// 延迟设置新数据,确保 UI 有时间响应清空操作
nextTick(() => {
messageList.value = [...ancestorsList, ...currentList]
params.versionID = current?.id
sketchList.value = imgList
console.log('11111111111111',params.versionID);
console.log('11111111111111', params.versionID)
})
}