From 0b8b58f85cc479dd8c8bac497a32c00c1a8c0c47 Mon Sep 17 00:00:00 2001
From: ChenZhaoYu <790348264@qq.com>
Date: Wed, 15 Feb 2023 15:01:33 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=96=E6=B6=88=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=E5=88=A4=E6=96=AD=E5=AD=97=E6=AE=B5=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/business/Chat/index.vue | 4 +++-
src/views/home/index.vue | 4 ----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/components/business/Chat/index.vue b/src/components/business/Chat/index.vue
index d7f30f4..29fd73a 100644
--- a/src/components/business/Chat/index.vue
+++ b/src/components/business/Chat/index.vue
@@ -31,6 +31,8 @@ async function handleSubmit() {
if (loading.value)
return
+ controller = new AbortController()
+
const message = prompt.value.trim()
if (!message || !message.length) {
@@ -53,7 +55,7 @@ async function handleSubmit() {
addMessage(data?.text ?? '', { options: { conversationId: data.conversationId, parentMessageId: data.id } })
}
catch (error: any) {
- if (error.message !== 'cancelled')
+ if (error.message !== 'canceled')
addMessage(`${error.message ?? 'Request failed, please try again later.'}`, { error: true })
}
finally {
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 53a37f3..8d5c0ec 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -7,7 +7,3 @@ import { Chat } from '@/components/business'
-
-