补齐收件回复入口并限制原邮件归属与类型
This commit is contained in:
1 parent
ec1481c99f
commit
0ef04823ab
6 files changed
+13
-3
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// 管理后台统一使用中文。
|
||||
const lang = {
|
||||
"mail_reply": "回复",
|
||||
"mail_no_subject": "(无主题)",
|
||||
"draft_save": "保存草稿",
|
||||
"draft_saved": "草稿已保存",
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user