注册添加校验

master
JayChou 2 weeks ago
parent cba1042fdf
commit f225abde7f
  1. 1
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister.vue
  2. 2
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister4faren.vue
  3. 2
      jeecgboot-vue3/src/views/system/loginmini/MiniRegister4shenbaoren.vue
  4. 23
      jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue

@ -181,6 +181,7 @@
createMessage.warn(t('sys.login.passwordPlaceholder')); createMessage.warn(t('sys.login.passwordPlaceholder'));
return; return;
} }
if (!formData.confirmPassword) { if (!formData.confirmPassword) {
createMessage.warn(t('sys.login.confirmPassword')); createMessage.warn(t('sys.login.confirmPassword'));
return; return;

@ -246,7 +246,7 @@
return; return;
} }
// 8 // 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)) { if (!passwordRegex.test(formData.password)) {
createMessage.warn(t('sys.login.passwordPlaceholderNotReg')); createMessage.warn(t('sys.login.passwordPlaceholderNotReg'));
return; return;

@ -246,7 +246,7 @@
return; return;
} }
// 8 // 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)) { if (!passwordRegex.test(formData.password)) {
createMessage.warn(t('sys.login.passwordPlaceholderNotReg')); createMessage.warn(t('sys.login.passwordPlaceholderNotReg'));
return; return;

@ -265,7 +265,28 @@
createMessage.warn(t('请输入工号')); createMessage.warn(t('请输入工号'));
return; 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) { if (!formData.phone) {
createMessage.warn(t('请输入电话')); createMessage.warn(t('请输入电话'));

Loading…
Cancel
Save