From e0a71526e0138a89f2dae838c36eaf9e99994a51 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 01 七月 2024 16:27:46 +0800
Subject: [PATCH] 修改密码验证

---
 src/components/tool/value-table.vue |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 915b452..0f74844 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -793,21 +793,30 @@
             return
           }
         }
-        this.upLoad = true
         for (var a in this.data.selectField) {
           if (this.data.selectField[a].choose == true) {
             this.upData[a] = JSON.stringify(this.upData[a])
           }
         }
-        this.upHead.forEach((item, index) => {
-          if (this.data.cascaderField && this.data.cascaderField[item.label]) {
-            if (this.upData[item.label]) {
-              this.upData[item.label] = JSON.stringify(this.upData[item.label])
-            } else {
-              this.upData[item.label] = ''
+        for (var i = 0; i < this.upHead.length; i++) {
+          if(this.upHead[i].label == 'password'){
+            if(this.upData[this.upHead[i].label]){
+              const reg2 =/^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)(?=.*?[~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?])[a-zA-Z\d~!#@$%^*&()_+{}\[\]|\\;:'",<.>\/?]*$/;
+              if (!reg2.test(this.upData[this.upHead[i].label])) {
+                this.$message.error('瀵嗙爜蹇呴』鍖呮嫭鏁板瓧銆佸ぇ灏忓啓瀛楁瘝浠ュ強鐗规畩瀛楃')
+                return
+              }
             }
           }
-        })
+          if (this.data.cascaderField && this.data.cascaderField[this.upHead[i].label]) {
+            if (this.upData[this.upHead[i].label]) {
+              this.upData[this.upHead[i].label] = JSON.stringify(this.upData[this.upHead[i].label])
+            } else {
+              this.upData[this.upHead[i].label] = ''
+            }
+          }
+        }
+        this.upLoad = true
         this.$axios.post(this.upUrl, this.upData, {
           headers: {
             'Content-Type': 'application/json'

--
Gitblit v1.9.3