diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue index bff2281cf7..89b15fa6d3 100644 --- a/frontend/src/business/components/settings/personal/PersonSetting.vue +++ b/frontend/src/business/components/settings/personal/PersonSetting.vue @@ -86,6 +86,7 @@ import MsDialogFooter from "../../common/components/MsDialogFooter"; import {getCurrentUser, listenGoBack, removeGoBackListener} from "../../../../common/js/utils"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; + import {PHONE_REGEX} from "@/common/js/regex"; export default { name: "MsPersonSetting", @@ -115,7 +116,7 @@ phone: [ { required: false, - pattern: '^1(3|4|5|7|8)\\d{9}$', + pattern: PHONE_REGEX, message: this.$t('member.mobile_number_format_is_incorrect'), trigger: 'blur' } diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index 4fc1069521..5be7dcc5ae 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -338,6 +338,7 @@ import {hasRole, listenGoBack, removeGoBackListener} from "@/common/js/utils"; import MsRolesTag from "../../common/components/MsRolesTag"; import {ROLE_ADMIN} from "@/common/js/constants"; import {getCurrentUser} from "../../../../common/js/utils"; +import {PHONE_REGEX} from "@/common/js/regex"; export default { name: "MsUser", @@ -401,7 +402,7 @@ export default { {required: true, message: this.$t('user.input_phone'), trigger: 'blur'}, { required: true, - pattern: '^1(3|4|5|7|8)\\d{9}$', + pattern: PHONE_REGEX, message: this.$t('user.mobile_number_format_is_incorrect'), trigger: 'blur' } diff --git a/frontend/src/common/js/regex.js b/frontend/src/common/js/regex.js new file mode 100644 index 0000000000..9320e4d0c0 --- /dev/null +++ b/frontend/src/common/js/regex.js @@ -0,0 +1 @@ +export const PHONE_REGEX = '^1(3|4|5|7|8|9)\\d{9}$';