feat(mail): 支持邮件正文 HTML 翻译并切换显示译文

- 后端翻译接口新增返回 translatedHtml,优先翻译邮件 HTML 文本节点并跳过脚本、样式等标签。
- 前端合并翻译结果展示,支持在原文与译文之间切换,并直接渲染翻译后的邮件 HTML。
This commit is contained in:
LanQin
2026-06-27 15:35:41 +08:00
parent ed68abb00d
commit ecc3e8a246
3 changed files with 102 additions and 23 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ export type MailMessage = {
export type DNSRecord = { type: string; name: string; value: string; ttl: number }
export type DNSCheckResult = { domain: string; status: string; checks: Record<string, { ok: boolean; message: string; found?: string[] }> }
export type ListResponse<T> = { items: T[]; nextCursor?: string }
export type MailTranslation = { translatedText: string; sourceLanguage?: string; targetLanguage: string; truncated: boolean }
export type MailTranslation = { translatedText: string; translatedHtml?: string; sourceLanguage?: string; targetLanguage: string; truncated: boolean }
export type SendPayload = { mailboxId?: string; to: string[]; cc: string[]; bcc: string[]; subject: string; text: string; html: string; attachments: { filename: string; contentType: string; contentBase64: string }[] }
export type DraftPayload = Omit<SendPayload, "attachments"> & { attachments?: SendPayload["attachments"] }
export type ScheduleSendPayload = SendPayload & { draftId?: string; sendAt: string }