From 6e61b49f9cddbda65bad95af5d6300265384c37f Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 28 十月 2025 09:28:35 +0800
Subject: [PATCH] 页面

---
 admin/src/components/system/user/ResetPwdWindow.vue |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/admin/src/components/system/user/ResetPwdWindow.vue b/admin/src/components/system/user/ResetPwdWindow.vue
index 287ce32..aca9656 100644
--- a/admin/src/components/system/user/ResetPwdWindow.vue
+++ b/admin/src/components/system/user/ResetPwdWindow.vue
@@ -9,7 +9,7 @@
     <p class="tip" v-if="user != null">涓虹敤鎴� <em>{{user.realname}}</em> 閲嶇疆瀵嗙爜</p>
     <el-form :model="form" ref="form" :rules="rules">
       <el-form-item label="鏂板瘑鐮�" prop="password" required>
-        <el-input v-model="form.password" type="password" placeholder="璇疯緭鍏ユ柊瀵嗙爜" maxlength="30" show-password></el-input>
+        <el-input v-model="form.password" type="password" placeholder="鑷冲皯鍖呮嫭鏁板瓧銆佸ぇ鍐欏瓧姣嶃�佸皬鍐欏瓧姣嶃�佺壒娈婂瓧绗︿腑鐨勪笁绉嶅瓧绗︼紝涓旇嚦灏�8浣嶆暟" maxlength="30" show-password></el-input>
       </el-form-item>
     </el-form>
   </GlobalWindow>
@@ -31,7 +31,7 @@
       },
       rules: {
         password: [
-          { required: true, message: '璇疯緭鍏ュ瘑鐮�' }
+          { validator: this.validatePassword, trigger: 'blur' }
         ]
       }
     }
@@ -44,6 +44,22 @@
         this.$refs.form.resetFields()
       })
     },
+    validatePassword (rule, value, callback) {
+      if (!value) {
+        callback(new Error('璇疯緭鍏ュ瘑鐮�'))
+      } else {
+        let typeCount = 0;
+        if (/[a-z]/.test(value)) typeCount++; // 灏忓啓瀛楁瘝
+        if (/[A-Z]/.test(value)) typeCount++; // 澶у啓瀛楁瘝
+        if (/\d/.test(value)) typeCount++;    // 鏁板瓧
+        if (/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(value)) typeCount++; // 鐗规畩瀛楃
+        if (typeCount >= 3) {
+          callback()
+        } else {
+          callback(new Error('鑷冲皯鍖呮嫭鏁板瓧銆佸ぇ鍐欏瓧姣嶃�佸皬鍐欏瓧姣嶃�佺壒娈婂瓧绗︿腑鐨勪笁绉嶅瓧绗︼紝涓旇嚦灏�8浣嶆暟'))
+        }
+      }
+    },
     // 纭閲嶇疆瀵嗙爜
     confirm () {
       if (this.isWorking) {

--
Gitblit v1.9.3