From 6cb8e5923b2c559f003f4a966c0388b5892bbeef Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 13 Apr 2023 15:05:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E9=A3=9E=E4=B9=A6=E5=90=8C=E6=AD=A5=E7=9A=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=97=A0=E6=B3=95=E9=80=9A=E8=BF=87?= =?UTF-8?q?DE=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/user/UserEditer.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/system/user/UserEditer.vue b/frontend/src/views/system/user/UserEditer.vue index 37997c3ad5..86afa5428b 100644 --- a/frontend/src/views/system/user/UserEditer.vue +++ b/frontend/src/views/system/user/UserEditer.vue @@ -420,8 +420,11 @@ export default { return } const regep = new RegExp(/^1[3-9]\d{9}$/) - - if (!regep.test(value)) { + let phoneNumber = value + if (value.length > 3 && value.startsWith('+86')) { + phoneNumber = value.substr(3) + } + if (!regep.test(phoneNumber)) { const msg = this.$t('user.phone_format') callback(new Error(msg)) } else {