From b609f77709c4646daf155341475ae14fc0c7943d Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: 星期五, 27 六月 2025 13:25:30 +0800
Subject: [PATCH] 修改

---
 src/utils/validate.js |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/utils/validate.js b/src/utils/validate.js
index e78759b..0a650f0 100644
--- a/src/utils/validate.js
+++ b/src/utils/validate.js
@@ -1,5 +1,5 @@
 /**
- * 判断url是否是http或https 
+ * 判断url是否是http或https
  * @param {string} path
  * @returns {Boolean}
  */
@@ -22,13 +22,14 @@
 }
 
 export function verifyUsername(val) {
-  var regex = /^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]{5,16}$/;  // 正则表达式,\d 匹配数字,{11} 表示匹配11次
-  return regex.test(val);
+  // var regex = /^(?=.*[a-zA-Z])|(?=.*\d)[a-zA-Z\d]{5,16}$/;  // 正则表达式,\d 匹配数字,{11} 表示匹配11次
+  var regex = /^[0-9a-zA-Z]{5,16}$/g
+  return regex.test(val)
 }
 
 export function verifyPwd(val) {
   // false: 强密码不正确
-  if (!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(val)) return false;
+  if (!/^(?![a-zA-Z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-Z\d]+$)(?![a-zA-Z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*\-_]{6,16}$/.test(val)) return false;
   // true: 强密码正确
   else return true;
 }
@@ -112,4 +113,4 @@
 export function verifyIdCard(val) {
   var regex = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
   return regex.test(val)
-}
\ No newline at end of file
+}

--
Gitblit v1.9.2