Skip to content

fix: 【应用】问答页面在回答中...时,点击停止回答不生效 #109 #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
>
抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。
</el-card>
<el-card v-else-if="item.is_stop" shadow="always" class="dialog-card">
已停止回答
</el-card>
<el-card v-else shadow="always" class="dialog-card">
回答中 <span class="dotting"></span>
</el-card>
Expand Down Expand Up @@ -434,6 +437,8 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean) {
vote_status: '-1'
})
chatList.value.push(chat)
ChatManagement.addChatRecord(chat, 50, loading)
ChatManagement.write(chat.id)
inputValue.value = ''
nextTick(() => {
// 将滚动条滚动到最下面
Expand Down Expand Up @@ -471,8 +476,6 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean) {
// 将滚动条滚动到最下面
scrollDiv.value.setScrollTop(getMaxHeight())
})
ChatManagement.addChatRecord(chat, 50, loading)
ChatManagement.write(chat.id)
const reader = response.body.getReader()
// 处理流数据
const write = getWrite(
Expand Down
Loading