补齐收件回复入口并限制原邮件归属与类型
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-27 20:51:16 +08:00
1 parent d5073cccbe
commit 6a35d0d2b7
6 files changed
+13 -3

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ const plainBody = message => {
}
export function prepareReply(message, identity) {
if (message.type !== 0) throw new Error(lang.fail)
const replyTo = readAddresses(message.reply_to)
const recipients = replyTo.length ? replyTo : [{EmailAddress: message.from_address, Name: message.from_name}]
if (!recipients.length || recipients.some(item => !item.EmailAddress || /[\r\n]/.test(item.EmailAddress))) {
@@ -93,7 +93,7 @@ export function usePage() {
const backToList = () => router.push({name: 'list'})
const handleReply = () => {
const id = Number(detailData.value.id)
if (loading.value || loadError.value || !Number.isSafeInteger(id) || id <= 0) return
if (loading.value || loadError.value || detailData.value.type !== 0 || !Number.isSafeInteger(id) || id <= 0) return
return router.push({name: 'editer', query: {reply: String(id)}})
}
@@ -5,6 +5,13 @@
<el-icon><Back /></el-icon>
</el-button>
<div v-if="!loading && !loadError" class="action-buttons">
<el-button
v-if="detailData.type === 0"
type="primary"
@click="handleReply"
>
{{ lang.mail_reply }}
</el-button>
<el-button plain @click="handleDelete" aria-label="删除邮件">
<el-icon><Delete /></el-icon>
</el-button>
@@ -90,6 +97,7 @@
import { usePage, Back, Delete, Document, Download } from './EmailDetail.js'
const {
handleReply,
handleDelete,
loading,
loadError,