diff --git a/components/ChatSidebar.vue b/components/ChatSidebar.vue index 0ec2dbb..7e54771 100644 --- a/components/ChatSidebar.vue +++ b/components/ChatSidebar.vue @@ -73,9 +73,9 @@ - {{chat.agent_data.title}} + {{truncateText(chat.agent_data?.title) || "加载中"}} - {{chat.title}} + {{truncateText(chat.title)}} { + if (!text) return '' + return text.length > maxLength ? text.substring(0, maxLength) + '...' : text + } + onMounted(async () => { UserToken.value = getToken() const UserInfo = await getUserInfo(UserToken.value) diff --git a/pages/Chat/Chat.vue b/pages/Chat/Chat.vue index 6212087..26a5bc3 100644 --- a/pages/Chat/Chat.vue +++ b/pages/Chat/Chat.vue @@ -84,8 +84,9 @@ @scrolltoupper="loadMoreMessages" :upper-threshold="0" :scroll-with-animation="true" @scroll="onScroll"> - +