优化多个地方

This commit is contained in:
eoao
2025-09-03 08:31:44 +08:00
parent 97a7950808
commit b4954e948b
30 changed files with 156 additions and 89 deletions

View File

@@ -12,6 +12,7 @@ import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
import roleService from '../service/role-service';
import verifyUtils from '../utils/verify-utils';
import r2Service from '../service/r2-service';
dayjs.extend(utc);
dayjs.extend(timezone);
@@ -152,7 +153,7 @@ export async function email(message, env, ctx) {
attachment.accountId = emailRow.accountId;
});
if (attachments.length > 0 && env.r2) {
if (attachments.length > 0 && await r2Service.hasOSS({env})) {
await attService.addAtt({ env }, attachments);
}