From 0eba9aaa37658c021b6e480bd78092f8cecb257b Mon Sep 17 00:00:00 2001 From: ivamp Date: Sun, 4 Aug 2024 23:28:33 +0800 Subject: [PATCH] =?UTF-8?q?chat:=20=E6=94=B9=E8=BF=9B=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=9F=BA=E4=BA=8E=E8=A7=92=E8=89=B2=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在[index.vue](file://src/pages/chats/[id]/index.vue)中,根据消息的`role`属性调整消息的显示方式,以区分不同角色(`assistant`、`system`和`user`)的消息显示。 同时,移除了无用的注释代码,并对界面布局进行了微调,以优化用户阅读体验。 --- src/components/AppBar.vue | 12 ++++++++++++ src/pages/chats/[id]/index.vue | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/components/AppBar.vue b/src/components/AppBar.vue index 8b084c3..5f7f66e 100644 --- a/src/components/AppBar.vue +++ b/src/components/AppBar.vue @@ -72,6 +72,18 @@ const chats = computed(() => { }); chatStore.getChats(); +let waitUpdate = false; +chatStore.$subscribe(() => { + if (waitUpdate) { + return; + } + waitUpdate = true; + setTimeout(() => { + chatStore.getChats(); + waitUpdate = false; + }, 1000); +}); + // 恼 // setInterval(() => { // chats.value.data = chatStore.chats.data diff --git a/src/pages/chats/[id]/index.vue b/src/pages/chats/[id]/index.vue index 4e05ab9..2a679e0 100644 --- a/src/pages/chats/[id]/index.vue +++ b/src/pages/chats/[id]/index.vue @@ -22,8 +22,13 @@ - - +
+ +
+ +
+ +