improvement(chat): 表情消息支持一键下载并优化渲染

useApi 增加 downloadChatEmoji,对接后端表情下载接口

聊天页识别远程表情地址并提供下载入口;下载成功后切换为本地表情 URL

修正文本混排表情的渲染结构并微调选中态颜色
This commit is contained in:
2977094657
2025-12-18 21:19:29 +08:00
parent eaec54a517
commit 6a35ac33f5
2 changed files with 100 additions and 11 deletions

View File

@@ -95,6 +95,18 @@ export const useApi = () => {
return await request(url, { method: 'POST' })
}
const downloadChatEmoji = async (data = {}) => {
return await request('/chat/media/emoji/download', {
method: 'POST',
body: {
account: data.account || null,
md5: data.md5 || '',
emoji_url: data.emoji_url || '',
force: !!data.force
}
})
}
// 获取图片解密密钥
const getMediaKeys = async (params = {}) => {
const query = new URLSearchParams()
@@ -135,6 +147,7 @@ export const useApi = () => {
listChatSessions,
listChatMessages,
openChatMediaFolder,
downloadChatEmoji,
getMediaKeys,
saveMediaKeys,
decryptAllMedia