【增加】AI 聊天发送,判断是否存在对话

This commit is contained in:
cherishsince 2024-05-17 17:11:23 +08:00
parent 1a1e53ae70
commit f6f786f1b6

View File

@ -175,6 +175,13 @@ const onSend = async (val?: string) => {
})
return
}
if (activeConversationId.value == null) {
ElMessage({
message: '还没创建对话,不能发送!',
type: 'error'
})
return
}
// TODO UI
//
prompt.value = ''
@ -346,21 +353,6 @@ onMounted(async () => {
}
//
await getMessageList()
// scrollToBottom();
// await nextTick
//
// messageContainer.value.addEventListener('scroll', handleScroll)
// copy
// messageContainer.value.addEventListener('click', (e: any) => {
// console.log(e)
// if (e.target.id === 'copy') {
// copy(e.target?.dataset?.copy)
// ElMessage({
// message: '!',
// type: 'success'
// })
// }
// })
})
</script>