From 775954ee5201068df417d859413dd861b181fe1b Mon Sep 17 00:00:00 2001 From: HCode <71808213+hyf-github-user@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:22:41 +0800 Subject: [PATCH] Fit chat stop (#141) --- ...acloud-nexior-1ce8927e-821b-47b5-9fb1-12c7355693e8.json | 7 +++++++ src/operators/chat.ts | 1 + src/pages/chat/Conversation.vue | 4 +--- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 change/@acedatacloud-nexior-1ce8927e-821b-47b5-9fb1-12c7355693e8.json diff --git a/change/@acedatacloud-nexior-1ce8927e-821b-47b5-9fb1-12c7355693e8.json b/change/@acedatacloud-nexior-1ce8927e-821b-47b5-9fb1-12c7355693e8.json new file mode 100644 index 00000000..6a12307e --- /dev/null +++ b/change/@acedatacloud-nexior-1ce8927e-821b-47b5-9fb1-12c7355693e8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix stop", + "packageName": "@acedatacloud/nexior", + "email": "1348977728@qq.com", + "dependentChangeType": "patch" +} diff --git a/src/operators/chat.ts b/src/operators/chat.ts index 4c7a1e8a..84ca3eb8 100644 --- a/src/operators/chat.ts +++ b/src/operators/chat.ts @@ -24,6 +24,7 @@ class ChatOperator { 'Content-Type': 'application/json', Accept: 'text/event-stream' }, + signal: options.signal, body: JSON.stringify(data) }) .then((response) => { diff --git a/src/pages/chat/Conversation.vue b/src/pages/chat/Conversation.vue index b39a647a..5b864898 100644 --- a/src/pages/chat/Conversation.vue +++ b/src/pages/chat/Conversation.vue @@ -228,7 +228,6 @@ export default defineComponent({ return; } let conversationId = this.conversationId; - this.canceler = new AbortController(); chatOperator .updateConversation( { @@ -237,8 +236,7 @@ export default defineComponent({ messages: updatedMessages }, { - token, - signal: this.canceler.signal + token } ) .then(async () => {