mirror of
https://gitee.com/lijingbo-2021/open-anylink-web.git
synced 2025-12-30 02:52:26 +00:00
bug fixed
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <span></span>
|
||||
}
|
||||
|
||||
@@ -191,8 +191,7 @@ const renderAudio = (audioId) => {
|
||||
<MsgBoxAudio
|
||||
url={url}
|
||||
fileName={audioData.audio[audioId].fileName}
|
||||
size={audioData.audio[audioId].size}
|
||||
></MsgBoxAudio>
|
||||
size={audioData.audio[audioId].size}></MsgBoxAudio>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${audioId}]`}</span>
|
||||
@@ -217,8 +216,7 @@ const renderImage = (imgId, isScreenShot = false) => {
|
||||
imgId={imgId}
|
||||
isScreenShot={isScreenShot}
|
||||
thumbWidth={imageData.image[imgId].thumbWidth}
|
||||
thumbHeight={imageData.image[imgId].thumbHeight}
|
||||
></MsgBoxImage>
|
||||
thumbHeight={imageData.image[imgId].thumbHeight}></MsgBoxImage>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${imgId}]`}</span>
|
||||
@@ -236,8 +234,7 @@ const renderVideo = (videoId, msgId) => {
|
||||
fileName={videoData.video[videoId].fileName}
|
||||
size={videoData.video[videoId].size}
|
||||
width={videoData.video[videoId].width}
|
||||
height={videoData.video[videoId].height}
|
||||
></MsgBoxVideo>
|
||||
height={videoData.video[videoId].height}></MsgBoxVideo>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${videoId}]`}</span>
|
||||
@@ -252,8 +249,7 @@ const renderDocument = (documentId) => {
|
||||
url={url}
|
||||
fileName={documentData.document[documentId].fileName}
|
||||
fileSize={documentData.document[documentId].size}
|
||||
contentType={documentData.document[documentId].documentType}
|
||||
></MsgBoxDocument>
|
||||
contentType={documentData.document[documentId].documentType}></MsgBoxDocument>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${documentId}]`}</span>
|
||||
@@ -316,8 +312,7 @@ const renderForwardTogether = (forwardContent, msgId) => {
|
||||
})
|
||||
// 挂载到新创建的容器
|
||||
app.mount(container)
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
<div class={'main'}>
|
||||
<span class={'title'}>{title}</span>
|
||||
<div class={'msg-list'}>
|
||||
|
||||
@@ -232,7 +232,7 @@ const historyMsgsShow = computed(() => {
|
||||
data = historyMsgs.value.filter((msg) => {
|
||||
const arr = jsonParseSafe(msg.content)
|
||||
// 不允许非结构化的content
|
||||
if (!arr) {
|
||||
if (!arr || !Array.isArray(arr) || arr.length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ const loadRelatedMsg = async () => {
|
||||
for (const msg of historyMsgs.value) {
|
||||
const content = msg.content
|
||||
const arr = jsonParseSafe(content)
|
||||
if (!arr) {
|
||||
if (!arr || !Array.isArray(arr) || arr.length === 0) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -404,7 +404,7 @@ const renderContent = ({ msg }) => {
|
||||
const msgId = msg.msgId
|
||||
const arr = jsonParseSafe(content)
|
||||
// 不允许非结构化的content
|
||||
if (!arr) {
|
||||
if (!arr || !Array.isArray(arr) || arr.length === 0) {
|
||||
return <span></span>
|
||||
}
|
||||
|
||||
@@ -464,8 +464,7 @@ const renderAudio = (audioId) => {
|
||||
<MsgBoxAudio
|
||||
url={url}
|
||||
fileName={audioData.audio[audioId].fileName}
|
||||
size={audioData.audio[audioId].size}
|
||||
></MsgBoxAudio>
|
||||
size={audioData.audio[audioId].size}></MsgBoxAudio>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${audioId}]`}</span>
|
||||
@@ -490,8 +489,7 @@ const renderImage = (imgId, isScreenShot = false) => {
|
||||
imgId={imgId}
|
||||
isScreenShot={isScreenShot}
|
||||
thumbWidth={imageData.image[imgId].thumbWidth}
|
||||
thumbHeight={imageData.image[imgId].thumbHeight}
|
||||
></MsgBoxImage>
|
||||
thumbHeight={imageData.image[imgId].thumbHeight}></MsgBoxImage>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${imgId}]`}</span>
|
||||
@@ -509,8 +507,7 @@ const renderVideo = (videoId, msgId) => {
|
||||
fileName={videoData.video[videoId].fileName}
|
||||
size={videoData.video[videoId].size}
|
||||
width={videoData.video[videoId].width}
|
||||
height={videoData.video[videoId].height}
|
||||
></MsgBoxVideo>
|
||||
height={videoData.video[videoId].height}></MsgBoxVideo>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${videoId}]`}</span>
|
||||
@@ -525,8 +522,7 @@ const renderDocument = (documentId) => {
|
||||
url={url}
|
||||
fileName={documentData.document[documentId].fileName}
|
||||
fileSize={documentData.document[documentId].size}
|
||||
contentType={documentData.document[documentId].documentType}
|
||||
></MsgBoxDocument>
|
||||
contentType={documentData.document[documentId].documentType}></MsgBoxDocument>
|
||||
)
|
||||
} else {
|
||||
return <span>{`[${documentId}]`}</span>
|
||||
@@ -589,8 +585,7 @@ const renderForward = (forwardContent, msgId) => {
|
||||
})
|
||||
// 挂载到新创建的容器
|
||||
app.mount(container)
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
<div class={'main'}>
|
||||
<span class={'title'}>{title}</span>
|
||||
<div class={'msg-list'}>
|
||||
|
||||
@@ -731,7 +731,7 @@ const renderContent = async (content) => {
|
||||
|
||||
const arr = jsonParseSafe(content)
|
||||
// 不允许非结构化的content
|
||||
if (!arr) {
|
||||
if (!arr || !Array.isArray(arr) || arr.length === 0) {
|
||||
quill.value.setText('')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ onMounted(async () => {
|
||||
*/
|
||||
const loadRelatedMsg = async () => {
|
||||
const arr = jsonParseSafe(msg.value.content)
|
||||
if (!arr) {
|
||||
if (!arr || !Array.isArray(arr) || arr.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ const renderComponent = (content) => {
|
||||
const arr = jsonParseSafe(content)
|
||||
|
||||
// 不允许非结构化的content
|
||||
if (!arr) {
|
||||
if (!arr || !Array.isArray(arr) || arr.length === 0) {
|
||||
return h('span', '')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user