提交 ae981e76 作者: 毛细亚

优化AI聊天组件上下文清除功能

上级 1e78ce8c
...@@ -213,6 +213,7 @@ export default { ...@@ -213,6 +213,7 @@ export default {
this.getWelcomeMsg() this.getWelcomeMsg()
console.log(this.chatUserInfo, 'this.chatUserInfo') console.log(this.chatUserInfo, 'this.chatUserInfo')
this.initanswerItem() this.initanswerItem()
this.clearContext(false)
}, },
methods: { methods: {
async getWelcomeMsg() { async getWelcomeMsg() {
...@@ -241,17 +242,20 @@ export default { ...@@ -241,17 +242,20 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).then(async () => {
this.clearContext(true)
}).catch(() => {
this.$message.info('取消清除上下文')
})
},
async clearContext(showMsg) {
try { try {
const res = await corp_beta_question_session_clearTag() const res = await corp_beta_question_session_clearTag()
if (res.status_code === 1) { if (res.status_code === 1) {
this.$message.success('清除上下文成功') showMsg ? this.$message.success('清除上下文成功') : ''
} }
} catch (error) { } catch (error) {
this.$message.error('清除上下文失败') showMsg ? this.$message.error('清除上下文失败') : ''
} }
}).catch(() => {
this.$message.info('取消清除上下文')
})
}, },
async getAiArgenInfo() { async getAiArgenInfo() {
const res = await corp_beta_question_config({ const res = await corp_beta_question_config({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论