修复gmail附件和回复编辑器图片不显示

This commit is contained in:
eoao
2025-07-10 09:00:14 +08:00
parent f2c12216c8
commit 7e5a383bc6
10 changed files with 102 additions and 70 deletions

View File

@@ -25,7 +25,8 @@ export async function email(message, env, ctx) {
forwardStatus,
forwardEmail,
ruleEmail,
ruleType
ruleType,
r2Domain
} = await settingService.query({ env });
if (receive === settingConst.receive.CLOSE) {
@@ -45,8 +46,6 @@ export async function email(message, env, ctx) {
const email = await PostalMime.parse(content);
console.log(email)
const toName = email.to.find(item => item.address === message.to)?.name || '';
const params = {
@@ -82,13 +81,12 @@ export async function email(message, env, ctx) {
}
}
let emailRow = await emailService.receive({ env }, params, cidAttachments);
let emailRow = await emailService.receive({ env }, params, cidAttachments, r2Domain);
attachments.forEach(attachment => {
attachment.emailId = emailRow.emailId;
attachment.userId = emailRow.userId;
attachment.accountId = emailRow.accountId;
attachment.type = attachment.contentId ? attConst.type.EMBED : attConst.type.ATT;
});
if (attachments.length > 0 && env.r2) {