fix: 下载附件时保留原始文件名并添加时间戳

This commit is contained in:
sliverp
2026-01-30 14:53:13 +08:00
parent cef1e7406c
commit a13aacbc3b
2 changed files with 14 additions and 12 deletions

View File

@@ -254,8 +254,8 @@ MEDIA:/绝对路径/图片文件.png
if (event.attachments?.length) {
for (const att of event.attachments) {
// 下载附件到本地
const localPath = await downloadFile(att.url, downloadDir);
// 下载附件到本地,使用原始文件名
const localPath = await downloadFile(att.url, downloadDir, att.filename);
if (localPath) {
if (att.content_type?.startsWith("image/")) {
imageUrls.push(localPath);