mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
fix: 修复了企业微信会显示出id的问题 增加了新手教程提示
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -42,6 +42,10 @@ release
|
|||||||
# OS
|
# OS
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Electron dev cache
|
||||||
|
.electron/
|
||||||
|
.cache/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 忽略 Visual Studio 临时文件夹
|
# 忽略 Visual Studio 临时文件夹
|
||||||
|
|||||||
@@ -906,7 +906,7 @@ function ChatPage(_props: ChatPageProps) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (payloads.length > 0) {
|
if (payloads.length > 0) {
|
||||||
window.electronAPI.image.preload(payloads).catch(() => {})
|
window.electronAPI.image.preload(payloads).catch(() => { })
|
||||||
}
|
}
|
||||||
}, [currentSessionId, messages])
|
}, [currentSessionId, messages])
|
||||||
|
|
||||||
@@ -1434,7 +1434,7 @@ function MessageBubble({ message, session, showTime, myAvatarUrl, isGroupChat }:
|
|||||||
bytes[8] === 0x57 && bytes[9] === 0x45 && bytes[10] === 0x42 && bytes[11] === 0x50) {
|
bytes[8] === 0x57 && bytes[9] === 0x45 && bytes[10] === 0x42 && bytes[11] === 0x50) {
|
||||||
return 'image/webp'
|
return 'image/webp'
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch { }
|
||||||
return 'image/jpeg'
|
return 'image/jpeg'
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@@ -1501,7 +1501,7 @@ function MessageBubble({ message, session, showTime, myAvatarUrl, isGroupChat }:
|
|||||||
setSenderAvatarUrl(result.avatarUrl)
|
setSenderAvatarUrl(result.avatarUrl)
|
||||||
setSenderName(result.displayName)
|
setSenderName(result.displayName)
|
||||||
}
|
}
|
||||||
}).catch(() => {}).finally(() => {
|
}).catch(() => { }).finally(() => {
|
||||||
senderAvatarLoading.delete(sender)
|
senderAvatarLoading.delete(sender)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1597,7 +1597,7 @@ function MessageBubble({ message, session, showTime, myAvatarUrl, isGroupChat }:
|
|||||||
}
|
}
|
||||||
setImageHasUpdate(Boolean(result.hasUpdate))
|
setImageHasUpdate(Boolean(result.hasUpdate))
|
||||||
}
|
}
|
||||||
}).catch(() => {})
|
}).catch(() => { })
|
||||||
return () => {
|
return () => {
|
||||||
cancelled = true
|
cancelled = true
|
||||||
}
|
}
|
||||||
@@ -1685,6 +1685,12 @@ function MessageBubble({ message, session, showTime, myAvatarUrl, isGroupChat }:
|
|||||||
// 是否有引用消息
|
// 是否有引用消息
|
||||||
const hasQuote = message.quotedContent && message.quotedContent.length > 0
|
const hasQuote = message.quotedContent && message.quotedContent.length > 0
|
||||||
|
|
||||||
|
// 去除企业微信 ID 前缀
|
||||||
|
const cleanMessageContent = (content: string) => {
|
||||||
|
if (!content) return ''
|
||||||
|
return content.replace(/^[a-zA-Z0-9]+@openim:\n?/, '')
|
||||||
|
}
|
||||||
|
|
||||||
// 解析混合文本和表情
|
// 解析混合文本和表情
|
||||||
const renderTextWithEmoji = (text: string) => {
|
const renderTextWithEmoji = (text: string) => {
|
||||||
if (!text) return text
|
if (!text) return text
|
||||||
@@ -1895,14 +1901,14 @@ function MessageBubble({ message, session, showTime, myAvatarUrl, isGroupChat }:
|
|||||||
<div className="bubble-content">
|
<div className="bubble-content">
|
||||||
<div className="quoted-message">
|
<div className="quoted-message">
|
||||||
{message.quotedSender && <span className="quoted-sender">{message.quotedSender}</span>}
|
{message.quotedSender && <span className="quoted-sender">{message.quotedSender}</span>}
|
||||||
<span className="quoted-text">{renderTextWithEmoji(message.quotedContent || '')}</span>
|
<span className="quoted-text">{renderTextWithEmoji(cleanMessageContent(message.quotedContent || ''))}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="message-text">{renderTextWithEmoji(message.parsedContent)}</div>
|
<div className="message-text">{renderTextWithEmoji(cleanMessageContent(message.parsedContent))}</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// 普通消息
|
// 普通消息
|
||||||
return <div className="bubble-content">{renderTextWithEmoji(message.parsedContent)}</div>
|
return <div className="bubble-content">{renderTextWithEmoji(cleanMessageContent(message.parsedContent))}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -506,6 +506,7 @@ function WelcomePage({ standalone = false }: WelcomePageProps) {
|
|||||||
|
|
||||||
{dbKeyStatus && <div className="field-hint status-text">{dbKeyStatus}</div>}
|
{dbKeyStatus && <div className="field-hint status-text">{dbKeyStatus}</div>}
|
||||||
<div className="field-hint">获取密钥会自动识别最近登录的账号</div>
|
<div className="field-hint">获取密钥会自动识别最近登录的账号</div>
|
||||||
|
<div className="field-hint">如果获取秘钥失败 请在微信打开后等待10秒后再登录</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user