Browse Source

用户管理密码验证修改

xieqy 1 year ago
parent
commit
a7ccabd0f3
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/widgets/UserManagement/Widget.ts

+ 6 - 3
src/widgets/UserManagement/Widget.ts

@@ -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'));