fix: 修复回复bug

This commit is contained in:
韩庆伟 2025-05-21 19:54:21 +08:00
parent 185d04bc32
commit 8d3b8d3b3c

View File

@ -99,7 +99,7 @@
<view
v-for="(file, fileIdx) in msg.content.slice(0, 4)"
:key="fileIdx"
class="relative rounded-md overflow-hidden mr-1"
class="relative rounded-md overflow-hidden ml-2"
:class="{
'w-60 h-60': msg.content.length == 1,
'w-15 h-15': msg.content.length == 2,
@ -117,7 +117,7 @@
<image
v-if="file.uploadFileType === uploadFileTypeEm.image"
:src="file.url || file.tempFilePath"
class="w-full h-full object-cover ml-2"
class="w-full h-full object-cover"
/>
</view>
</view>
@ -1257,10 +1257,32 @@ function copyText(msg: IMessage) {
}
}
//
function refreshText() {
const lastUserMsg = historyUserMsgs[historyUserMsgs.length - 1]
lastUserMsg.timestamp = new Date()
sendText(lastUserMsg)
//
const lastUserMsg = messages.findLast((msg) => msg.role === 'user')
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)