feat: 支持显示本地 resource_cache 高质量图片#3
Open
tocer wants to merge 1 commit into
Open
Conversation
利用 DingTalk 本地缓存的高质量图片,而非缩略图。 ## 改动 - 后端: - 新增 ImageMapping 模型,迁移 im_image_info 表 - 消息 API 响应增加 local_image_url 字段 - 静态路由 /cache/ 指向 resource_cache 目录 - /static/ 路由指向 ImageFiles 目录(缩略图) - 前端: - 优先使用 local_image_url 显示高质量图片 - 降级到云端 URL 或缩略图 ## 效果 - 约 31%(144/463)的图片显示 720×348 高清版本 - 其余降级到缩略图(120×39,1.7KB) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能说明
利用 DingTalk 本地缓存的高质量图片,而非低质量缩略图。
问题
当前 dingwave 显示的图片是 ImageFiles 目录中的缩略图(120×39,1.7KB webp),而 DingTalk 实际上在 resource_cache 目录中缓存了高质量原图(720×348,几十KB)。
解决方案
通过迁移 im_image_info 表建立消息 ID 到本地高质量图片的映射关系。
改动
后端
前端
效果
启动命令
./dingwave -k -d dingtalk.db -p 8085
注意:需要 -k 参数指定用户 UID 才能解密数据库。