From 33fe4936b4ae6f3b784ec583ac58b055256153d2 Mon Sep 17 00:00:00 2001
From: GatlinHa <312777916@qq.com>
Date: Fri, 30 May 2025 22:28:21 +0800
Subject: [PATCH] bug fixed
---
src/js/utils/message.js | 2 +-
.../components/DialogForMsgForward.vue | 19 +++++++----------
.../components/DialogForMsgHistory.vue | 21 +++++++------------
src/views/message/components/InputEditor.vue | 2 +-
src/views/message/components/MessageItem.vue | 4 ++--
5 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/src/js/utils/message.js b/src/js/utils/message.js
index 7a612d4..3280235 100644
--- a/src/js/utils/message.js
+++ b/src/js/utils/message.js
@@ -10,7 +10,7 @@ const documentData = useDocumentStore()
export const showSimplifyMsgContent = (content) => {
const arr = jsonParseSafe(content)
- if (!arr) {
+ if (!arr || !Array.isArray(arr) || arr.length === 0) {
return content
}
diff --git a/src/views/message/components/DialogForMsgForward.vue b/src/views/message/components/DialogForMsgForward.vue
index f3b07f2..53dd76b 100644
--- a/src/views/message/components/DialogForMsgForward.vue
+++ b/src/views/message/components/DialogForMsgForward.vue
@@ -65,7 +65,7 @@ const loadRelatedMsg = async () => {
for (const msg of props.msgs) {
const content = msg.content
const arr = jsonParseSafe(content)
- if (!arr) {
+ if (!arr || !Array.isArray(arr) || arr.length === 0) {
continue
}
@@ -131,7 +131,7 @@ const renderContent = ({ msg }) => {
const msgId = msg.msgId
const arr = jsonParseSafe(content)
// 不允许非结构化的content
- if (!arr) {
+ if (!arr || !Array.isArray(arr) || arr.length === 0) {
return
}
@@ -191,8 +191,7 @@ const renderAudio = (audioId) => {