新增注册邮箱名自定义字符过滤
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const en = {
|
||||
'收件箱': 'Inbox',
|
||||
inbox: 'Inbox',
|
||||
drafts: 'Drafts',
|
||||
sent: 'Sent',
|
||||
starred: 'Starred',
|
||||
@@ -307,7 +307,9 @@ const en = {
|
||||
emailText: 'Email Text',
|
||||
emailPrefix: 'Email Prefix',
|
||||
atLeast: 'At Least',
|
||||
character: ''
|
||||
character: '',
|
||||
mustNotContain: 'Must Not Contain',
|
||||
mustNotContainDesc: 'Separate with commas'
|
||||
}
|
||||
|
||||
export default en
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const zh = {
|
||||
'收件箱': '收件箱',
|
||||
inbox: '收件箱',
|
||||
drafts: '草稿箱',
|
||||
sent: '已发送',
|
||||
starred: '星标邮件',
|
||||
@@ -192,8 +192,8 @@ const zh = {
|
||||
emptyEmailMsg: '邮箱不能为空',
|
||||
notEmailMsg: '输入的邮箱不合法',
|
||||
emptyPwdMsg: '密码不能为空',
|
||||
pwdLengthMsg: '密码最少六位',
|
||||
minEmailPrefix: '邮箱名不能小于{msg}位',
|
||||
pwdLengthMsg: '密码至少六位',
|
||||
minEmailPrefix: '邮箱名至少{msg}位',
|
||||
confirmPwdFailMsg: '两次密码输入不一致',
|
||||
emptyRegKeyMsg: '注册码不能为空',
|
||||
regSuccessMsg: '注册成功',
|
||||
@@ -228,7 +228,7 @@ const zh = {
|
||||
banRestore: '确认禁用 {msg} 吗?',
|
||||
logOut: '退出',
|
||||
clearContentConfirm: '确定要清空所有内容吗?',
|
||||
attLimitMsg: '附件大小限制28mb',
|
||||
attLimitMsg: '附件不能超过28MB',
|
||||
emptyRecipientMsg: '收件人邮箱地址不能为空',
|
||||
emptySubjectMsg: '主题不能为空',
|
||||
emptyContentMsg: '邮件正文不能为空',
|
||||
@@ -307,6 +307,8 @@ const zh = {
|
||||
emailText: '邮件文本',
|
||||
emailPrefix: '邮箱前缀',
|
||||
atLeast: '至少',
|
||||
character: '位'
|
||||
character: '位',
|
||||
mustNotContain: '禁止包含',
|
||||
mustNotContainDesc: '输入多个值用,分开'
|
||||
}
|
||||
export default zh
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<el-menu-item @click="router.push({name: 'email'})" index="email"
|
||||
:class="route.meta.name === 'email' ? 'choose-item' : ''">
|
||||
<Icon icon="hugeicons:mailbox-01" width="20" height="20" />
|
||||
<span class="menu-name" style="margin-left: 21px">{{$t('收件箱')}}</span>
|
||||
<span class="menu-name" style="margin-left: 21px">{{$t('inbox')}}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="router.push({name: 'send'})" index="send" v-perm="'email:send'"
|
||||
:class="route.meta.name === 'send' ? 'choose-item' : ''">
|
||||
@@ -96,8 +96,17 @@ const route = useRoute();
|
||||
color: #ffffff;
|
||||
background: linear-gradient(135deg, #1890ff, #3a80dd);
|
||||
transition: all 0.3s ease;
|
||||
max-width: 240px;
|
||||
padding: 0 10px;
|
||||
> div {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: calc(240px - 20px - 30px);
|
||||
}
|
||||
|
||||
:deep(.el-icon) {
|
||||
flex-shrink: 0;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const routes = [
|
||||
name: 'email',
|
||||
component: () => import('@/views/email/index.vue'),
|
||||
meta: {
|
||||
title: '收件箱',
|
||||
title: 'inbox',
|
||||
name: 'email',
|
||||
menu: true
|
||||
}
|
||||
|
||||
@@ -713,15 +713,20 @@
|
||||
</div>
|
||||
</form>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="emailPrefixShow" :title="t('emailPrefix')" width="30" >
|
||||
<el-dialog v-model="emailPrefixShow" :title="t('emailPrefix')" @closed="resetEmailPrefix" >
|
||||
<div class="email-prefix">
|
||||
<div>{{ t('atLeast') }}</div>
|
||||
<el-input-number v-model="minEmailPrefix" :min="1" :max="20" @change="EmailPrefixChange" style="width: 150px" >
|
||||
<el-input-number v-model="minEmailPrefix" :min="1" :max="20" style="width: 150px" >
|
||||
<template #suffix>
|
||||
<span>{{ t('character') }}</span>
|
||||
</template>
|
||||
</el-input-number>
|
||||
</div>
|
||||
<div class="prefix-filter">
|
||||
<div style="margin-bottom: 10px;">{{ t('mustNotContain') }}</div>
|
||||
<el-input-tag style="margin-bottom: 10px;" v-model="emailPrefixFilter" :placeholder="t('mustNotContainDesc')" />
|
||||
</div>
|
||||
<el-button type="primary" style="width: 100%;" :loading="settingLoading" @click="saveEmailPrefix">{{ $t('save') }}</el-button>
|
||||
</el-dialog>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@@ -777,6 +782,7 @@ const clearS3Loading = ref(false)
|
||||
const r2DomainInput = ref('')
|
||||
const loginOpacity = ref(0)
|
||||
const minEmailPrefix = ref(0)
|
||||
const emailPrefixFilter = ref([])
|
||||
const backgroundUrl = ref('')
|
||||
let backgroundFile = {}
|
||||
const showSetBackground = ref(false)
|
||||
@@ -868,6 +874,7 @@ function getSettings() {
|
||||
regVerifyCount.value = setting.value.regVerifyCount
|
||||
resetNoticeForm()
|
||||
resetAddS3Form()
|
||||
resetEmailPrefix()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1137,16 +1144,17 @@ function doOpacityChange() {
|
||||
editSetting(form, true)
|
||||
}
|
||||
|
||||
function doEmailPrefix() {
|
||||
const form = {}
|
||||
form.minEmailPrefix = minEmailPrefix.value
|
||||
editSetting(form, true)
|
||||
function resetEmailPrefix() {
|
||||
minEmailPrefix.value = setting.value.minEmailPrefix
|
||||
emailPrefixFilter.value = setting.value.emailPrefixFilter
|
||||
}
|
||||
|
||||
const EmailPrefixChange = debounce(doEmailPrefix, 1000, {
|
||||
leading: false,
|
||||
trailing: true
|
||||
})
|
||||
function saveEmailPrefix() {
|
||||
const form = {}
|
||||
form.minEmailPrefix = minEmailPrefix.value
|
||||
form.emailPrefixFilter = emailPrefixFilter.value
|
||||
editSetting(form, true)
|
||||
}
|
||||
|
||||
const opacityChange = debounce(doOpacityChange, 1000, {
|
||||
leading: false,
|
||||
@@ -1314,9 +1322,9 @@ function editSetting(settingForm, refreshStatus = true) {
|
||||
regVerifyCountShow.value = false
|
||||
noticePopupShow.value = false
|
||||
addS3Show.value = false
|
||||
emailPrefixShow.value = false
|
||||
}).catch((e) => {
|
||||
loginOpacity.value = setting.value.loginOpacity
|
||||
minEmailPrefix.value = setting.value.minEmailPrefix
|
||||
setting.value = {...setting.value, ...JSON.parse(backup)}
|
||||
}).finally(() => {
|
||||
settingLoading.value = false
|
||||
@@ -1675,6 +1683,11 @@ function editSetting(settingForm, refreshStatus = true) {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.prefix-filter {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.s3-button {
|
||||
display: grid;
|
||||
grid-template-columns: 80px 1fr;
|
||||
|
||||
Reference in New Issue
Block a user