fix: 取消提示判断字段错误

This commit is contained in:
ChenZhaoYu 2023-02-15 15:01:33 +08:00
parent c09a4f6c75
commit 0b8b58f85c
2 changed files with 3 additions and 5 deletions

View File

@ -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 {

View File

@ -7,7 +7,3 @@ import { Chat } from '@/components/business'
<Chat />
</div>
</template>
<style>
</style>