fix(系统设置): 邮箱验证

This commit is contained in:
shiziyuan9527 2021-05-31 11:50:05 +08:00 committed by 刘瑞斌
parent df783a624e
commit 5f3cde6725
3 changed files with 5 additions and 4 deletions

View File

@ -88,7 +88,7 @@ import {TokenKey} from "../../../../common/js/constants";
import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsDialogFooter from "../../common/components/MsDialogFooter";
import {getCurrentUser, listenGoBack, removeGoBackListener} from "../../../../common/js/utils"; import {getCurrentUser, listenGoBack, removeGoBackListener} from "../../../../common/js/utils";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import {PHONE_REGEX} from "@/common/js/regex"; import {EMAIL_REGEX, PHONE_REGEX} from "@/common/js/regex";
export default { export default {
name: "MsPersonSetting", name: "MsPersonSetting",
@ -126,7 +126,7 @@ export default {
{required: true, message: this.$t('member.input_email'), trigger: 'blur'}, {required: true, message: this.$t('member.input_email'), trigger: 'blur'},
{ {
required: true, required: true,
pattern: /^([A-Za-z0-9_\-.])+@([A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/, pattern: EMAIL_REGEX,
message: this.$t('member.email_format_is_incorrect'), message: this.$t('member.email_format_is_incorrect'),
trigger: 'blur' trigger: 'blur'
} }

View File

@ -111,7 +111,7 @@
</template> </template>
<script> <script>
import {PHONE_REGEX} from "@/common/js/regex"; import {EMAIL_REGEX, PHONE_REGEX} from "@/common/js/regex";
import {GROUP_ORGANIZATION, GROUP_PROJECT, GROUP_SYSTEM, GROUP_WORKSPACE} from "@/common/js/constants"; import {GROUP_ORGANIZATION, GROUP_PROJECT, GROUP_SYSTEM, GROUP_WORKSPACE} from "@/common/js/constants";
export default { export default {
@ -159,7 +159,7 @@ export default {
{required: true, message: this.$t('user.input_email'), trigger: 'blur'}, {required: true, message: this.$t('user.input_email'), trigger: 'blur'},
{ {
required: true, required: true,
pattern: /^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, pattern: EMAIL_REGEX,
message: this.$t('user.email_format_is_incorrect'), message: this.$t('user.email_format_is_incorrect'),
trigger: 'blur' trigger: 'blur'
} }

View File

@ -1 +1,2 @@
export const PHONE_REGEX = '^1(3|4|5|6|7|8|9)\\d{9}$'; export const PHONE_REGEX = '^1(3|4|5|6|7|8|9)\\d{9}$';
export const EMAIL_REGEX = '^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$';