From f225abde7fa08678fa43007867e45f631ad4e5c3 Mon Sep 17 00:00:00 2001 From: JayChou Date: Sun, 10 Nov 2024 18:30:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=B7=BB=E5=8A=A0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/loginmini/MiniRegister.vue | 1 + .../system/loginmini/MiniRegister4faren.vue | 2 +- .../loginmini/MiniRegister4shenbaoren.vue | 2 +- .../system/loginmini/MiniRegisterexp.vue | 23 ++++++++++++++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister.vue b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister.vue index 61a888f..4548bf4 100644 --- a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister.vue +++ b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister.vue @@ -181,6 +181,7 @@ createMessage.warn(t('sys.login.passwordPlaceholder')); return; } + if (!formData.confirmPassword) { createMessage.warn(t('sys.login.confirmPassword')); return; diff --git a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue index 1085f79..33ce11c 100644 --- a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue +++ b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue @@ -246,7 +246,7 @@ return; } //包含字母(大小写)、数字以及特殊字符,并且有一定的长度要求,至少 8 位 - const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$%^&+=!])(?=.{8,})$/; + const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])[A-Za-z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,20}$/; if (!passwordRegex.test(formData.password)) { createMessage.warn(t('sys.login.passwordPlaceholderNotReg')); return; diff --git a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4shenbaoren.vue b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4shenbaoren.vue index 903c8e3..8fbd95a 100644 --- a/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4shenbaoren.vue +++ b/jeecgboot-vue3/src/views/system/loginmini/MiniRegister4shenbaoren.vue @@ -246,7 +246,7 @@ return; } //包含字母(大小写)、数字以及特殊字符,并且有一定的长度要求,至少 8 位 - const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])[A-Za-z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,}$/; + const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])[A-Za-z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,20}$/; if (!passwordRegex.test(formData.password)) { createMessage.warn(t('sys.login.passwordPlaceholderNotReg')); return; diff --git a/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue b/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue index 5839b1d..430f0ce 100644 --- a/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue +++ b/jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue @@ -265,7 +265,28 @@ createMessage.warn(t('请输入工号')); return; } - + if (!formData.psd) { + createMessage.warn(t('sys.login.passwordPlaceholder')); + return; + } + //包含字母(大小写)、数字以及特殊字符,并且有一定的长度要求,至少 8 位 + const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])[A-Za-z\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]{8,20}$/; + if (!passwordRegex.test(formData.psd)) { + createMessage.warn(t('sys.login.passwordPlaceholderNotReg')); + return; + } + // if (!formData.workno) { + // createMessage.warn(t('sys.login.passwordPlaceholder')); + // return; + // } + if (!formData.sepsd) { + createMessage.warn(t('sys.login.confirmPassword')); + return; + } + if (formData.psd !== formData.sepsd) { + createMessage.warn(t('sys.login.diffPwd')); + return; + } if (!formData.phone) { createMessage.warn(t('请输入电话'));