From 8db1f37bacb592824a0ef19805b52da1da027e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Tue, 28 Mar 2023 13:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Home.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index f6f9fe8..0b5a788 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -4,7 +4,7 @@
{{ item.role == "user" ? "你" : pageTitle }} - +
@@ -38,6 +38,7 @@ export default { lists: [ { role: "system", + error: false, content: "请问有什么可以帮你的吗?", }, ], @@ -57,6 +58,7 @@ export default { if (!this.canUse || this.words == "") return; this.lists.push({ role: "user", + error: false, content: this.words, }); let requestData = { @@ -67,6 +69,7 @@ export default { this.lists.push({ role: "system", + error: false, content: "...", }); let lastMessage = this.lists[this.lists.length - 1]; @@ -85,7 +88,8 @@ export default { let answer = JSON.parse(Base64.decode(r.data.data)); lastMessage.content = answer.answer[0].message.content; } else { - lastMessage.content = "[网络错误]"; + lastMessage.error = true; + lastMessage.content = "[" + r.data.msg + "]"; } this.$nextTick(() => { this.$refs.wordsInput.focus(); @@ -153,6 +157,10 @@ export default { background-color: #ffffff; border-radius: 0 10px 10px 10px; } + .content.error { + color: #ffffff; + background-color: #ff0000; + } } .message-item.user { align-items: flex-end;