mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-10 08:25:34 +00:00
perf: 优化创建新会话数据
This commit is contained in:
parent
e98fe3eec5
commit
686a2e4fff
@ -1920,6 +1920,11 @@ export default {
|
|||||||
if (!this.isAiBot) {
|
if (!this.isAiBot) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 清理会话本地缓存
|
||||||
|
this.$store.dispatch("clearDialogMsgs", {
|
||||||
|
id: this.dialogId
|
||||||
|
});
|
||||||
|
// 创建新会话
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
url: 'dialog/session/create',
|
url: 'dialog/session/create',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -250,6 +250,11 @@ export default {
|
|||||||
const processQueue = async () => {
|
const processQueue = async () => {
|
||||||
try {
|
try {
|
||||||
for (const user of this.aiUser) {
|
for (const user of this.aiUser) {
|
||||||
|
// 清理会话本地缓存
|
||||||
|
this.$store.dispatch("clearDialogMsgs", {
|
||||||
|
id: this.dialogId
|
||||||
|
});
|
||||||
|
// 创建新会话
|
||||||
await this.$store.dispatch("call", {
|
await this.$store.dispatch("call", {
|
||||||
url: 'dialog/session/create',
|
url: 'dialog/session/create',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
21
resources/assets/js/store/actions.js
vendored
21
resources/assets/js/store/actions.js
vendored
@ -3316,10 +3316,9 @@ export default {
|
|||||||
* 关闭对话
|
* 关闭对话
|
||||||
* @param state
|
* @param state
|
||||||
* @param commit
|
* @param commit
|
||||||
* @param dispatch
|
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
closeDialog({state, commit, dispatch}, data) {
|
closeDialog({state, commit}, data) {
|
||||||
$A.syncDispatch("closeDialog", data)
|
$A.syncDispatch("closeDialog", data)
|
||||||
|
|
||||||
// 判断参数
|
// 判断参数
|
||||||
@ -3338,6 +3337,24 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理会话本地缓存
|
||||||
|
* @param state
|
||||||
|
* @param commit
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
clearDialogMsgs({state, commit}, data) {
|
||||||
|
$A.syncDispatch("clearDialogMsgs", data)
|
||||||
|
|
||||||
|
// 判断参数
|
||||||
|
if (!/^\d+$/.test(data.id)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理会话本地缓存
|
||||||
|
commit("message/save", state.dialogMsgs.filter(item => item.dialog_id != data.id))
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存待办数据
|
* 保存待办数据
|
||||||
* @param commit
|
* @param commit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user