Browse Source

用户管理密码验证修改

xieqy 1 year ago
parent
commit
8c09a82fce
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/widgets/UserManagement/Widget.ts

+ 7 - 4
src/widgets/UserManagement/Widget.ts

@@ -203,7 +203,7 @@ class UserManagement extends BaseWidget {
             Obj.domObj.find(".name").attr("readonly", "readonly");
             this.initPopeVue("update");
             this.getUnit("edit");
-            this.vueObject.popVue.data.password = "Q_QQaQQyQQ";
+            // this.vueObject.popVue.data.password = "Q_QQaQQyQQ";
             //添加验证
             (<any>$('#widget-UserManagementAddInfo')).bootstrapValidator();
             Obj.submitObj.off("click").on("click", function (e) {
@@ -771,6 +771,9 @@ class UserManagement extends BaseWidget {
                         if (!that.checkInput("联系电话", this.data.phone, /[0-9]{11}/)) {
                             return;
                         }
+                        if (!that.checkInput("密码", this.data.password, /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%&+-]{12,}$/)) {
+                            return;
+                        }
                         // if (!that.verificationHelper.isPhone(this.data.phone, that.toast)) {
                         //     return;
                         // };
@@ -798,7 +801,7 @@ class UserManagement extends BaseWidget {
                             this.data.isUpdate = 1;
                         }
                         if (this.data.password != "Q_QQaQQyQQ") {
-                            data.append("password", hex_sha1(this.data.password));
+                            data.append("password", sm3(this.data.password));
                         }
                         data.append("username", this.data.name);
                         data.append("id", this.data.id);
@@ -830,7 +833,7 @@ class UserManagement extends BaseWidget {
                         if (!that.checkInput("联系电话", this.data.phone, /[0-9]{11}/)) {
                             return;
                         }
-                        if (!that.checkInput("密码", this.data.password)) {
+                        if (!that.checkInput("密码", this.data.password, /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%&+-]{12,}$/)) {
                             return;
                         }
                         if (!that.checkInput("单位", this.data.deptid)) {
@@ -862,7 +865,7 @@ class UserManagement extends BaseWidget {
                         let files = $('#widget-UserManagementAddInfo .file')[0].files;
                         data.append("file", files[0]);
                         data.append("username", this.data.name);
-                        data.append("password", hex_sha1(this.data.password));
+                        data.append("password", sm3(this.data.password));
                         data.append("realName", this.data.realname);
                         data.append("idcard", that.desCodeConvert(this.data.idcard, 'encryption'));
                         data.append("phone", that.desCodeConvert(this.data.phone, 'encryption'));