Переглянути джерело

请输入至少8位数的密码

lifanagju_citu 6 місяців тому
батько
коміт
f01e8346c3

+ 5 - 2
src/views/login/components/editPassword.vue

@@ -72,9 +72,12 @@ const passwordType = ref(false)
 const phoneRef = ref()
 
 // 密码效验
-const regex = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/
+// const regex = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/
+// 请输入8-16位数由数字、大小写字母组成的密码
+
+const regex = /^[A-Za-z0-9]{8,}$/
 const validPassword = computed(() => {
-  return regex.test(query.password) || '请输入8-16位数由数字、大小写字母组成的密码'
+  return regex.test(query.password) || '请输入至少8位数的密码'
 })
 
 const confirmPassword = computed(() => {

+ 2 - 2
src/views/login/components/editPasswordEnt.vue

@@ -99,9 +99,9 @@ const loading = ref(false)
 const passwordType = ref(false)
 
 // 密码效验
-const regex = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/
+const regex = /^[A-Za-z0-9]{8,}$/
 const validPassword = computed(() => {
-  return regex.test(query.password) || '请输入8-16位数由数字、大小写字母组成的密码'
+  return regex.test(query.password) || '请输入至少8位数的密码'
 })
 
 const confirmPassword = computed(() => {

+ 2 - 2
src/views/login/components/passwordPage.vue

@@ -94,9 +94,9 @@ if (props.validEmail) {
 // }
 
 // 密码效验
-const regex = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/
+const regex = /^[A-Za-z0-9]{8,}$/
 const validPassword = computed(() => {
-  return regex.test(loginData.password) || '请输入8-16位数由数字、大小写字母组成的密码'
+  return regex.test(loginData.password) || '请输入至少8位数的密码'
 })
 
 const loginUserPhone = localStorage.getItem('loginUserPhone') || ''

+ 2 - 2
src/views/recruit/entRegister/register.vue

@@ -440,8 +440,8 @@ const passwordObj = {
       return '请输入账户登录密码'
     },
     value => {
-      if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
-      return '请输入8-16位数由数字、大小写字母组成的密码'
+      if (/^[A-Za-z0-9]{8,}$/.test(value)) return true
+      return '请输入至少8位数的密码'
     }
   ],
 }

+ 4 - 4
src/views/recruit/enterprise/staffChangePassword/index.vue

@@ -63,8 +63,8 @@ const formItems = ref({
           return '请输入新密码'
         },
         value => {
-          if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
-          return '请输入8-16位数由数字、大小写字母组成的密码'
+          if (/^[A-Za-z0-9]{8,}$/.test(value)) return true
+          return '请输入至少8位数的密码'
         }
       ]
     },
@@ -83,8 +83,8 @@ const formItems = ref({
           return '请再次输入新密码'
         },
         value => {
-          if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
-          return '请输入8-16位数由数字、大小写字母组成的密码'
+          if (/^[A-Za-z0-9]{8,}$/.test(value)) return true
+          return '请输入至少8位数的密码'
         }
       ]
     },