fix: 修复回复bug
This commit is contained in:
parent
185d04bc32
commit
8d3b8d3b3c
@ -99,7 +99,7 @@
|
|||||||
<view
|
<view
|
||||||
v-for="(file, fileIdx) in msg.content.slice(0, 4)"
|
v-for="(file, fileIdx) in msg.content.slice(0, 4)"
|
||||||
:key="fileIdx"
|
:key="fileIdx"
|
||||||
class="relative rounded-md overflow-hidden mr-1"
|
class="relative rounded-md overflow-hidden ml-2"
|
||||||
:class="{
|
:class="{
|
||||||
'w-60 h-60': msg.content.length == 1,
|
'w-60 h-60': msg.content.length == 1,
|
||||||
'w-15 h-15': msg.content.length == 2,
|
'w-15 h-15': msg.content.length == 2,
|
||||||
@ -117,7 +117,7 @@
|
|||||||
<image
|
<image
|
||||||
v-if="file.uploadFileType === uploadFileTypeEm.image"
|
v-if="file.uploadFileType === uploadFileTypeEm.image"
|
||||||
:src="file.url || file.tempFilePath"
|
:src="file.url || file.tempFilePath"
|
||||||
class="w-full h-full object-cover ml-2"
|
class="w-full h-full object-cover"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -1257,10 +1257,32 @@ function copyText(msg: IMessage) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重新发送逻辑
|
||||||
function refreshText() {
|
function refreshText() {
|
||||||
const lastUserMsg = historyUserMsgs[historyUserMsgs.length - 1]
|
// 获取最后一条用户消息(保留在消息列表中的)
|
||||||
lastUserMsg.timestamp = new Date()
|
const lastUserMsg = messages.findLast((msg) => msg.role === 'user')
|
||||||
sendText(lastUserMsg)
|
if (!lastUserMsg) return
|
||||||
|
|
||||||
|
// 克隆消息避免污染原始数据
|
||||||
|
const clonedMsg = {
|
||||||
|
...lastUserMsg,
|
||||||
|
timestamp: new Date(),
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送克隆后的消息
|
||||||
|
sendText(clonedMsg)
|
||||||
|
// // 获取最后一条用户消息(保留在消息列表中的)
|
||||||
|
// const lastUserMsg = messages.findLast((msg) => msg.role === 'user')
|
||||||
|
// if (!lastUserMsg) return
|
||||||
|
|
||||||
|
// // 克隆消息避免污染原始数据
|
||||||
|
// const newUserMsg = {
|
||||||
|
// ...lastUserMsg,
|
||||||
|
// timestamp: new Date(),
|
||||||
|
// }
|
||||||
|
// const historyToSend = [...messages, newUserMsg]
|
||||||
|
// // 发送克隆后的消息
|
||||||
|
// sendText(historyToSend)
|
||||||
}
|
}
|
||||||
|
|
||||||
const knowledgeOpen = ref(false)
|
const knowledgeOpen = ref(false)
|
||||||
|
Loading…
Reference in New Issue
Block a user