Browse Source

密码修改提示

xieqy 1 year ago
parent
commit
ff3328db53
2 changed files with 7 additions and 6 deletions
  1. 1 1
      src/widgets/Header/Widget.ts
  2. 6 5
      src/widgets/UserManagement/Widget.ts

+ 1 - 1
src/widgets/Header/Widget.ts

@@ -141,7 +141,7 @@ class Header extends BaseWidget {
             const newPwd: string = popup.domObj.find('.newPassWrodInt').val().toString().trim();
             const repeatNewPwd: string = popup.domObj.find('.repeatNewPassword').val().toString().trim();
             if (!pateen.test(newPwd) || !pateen.test(repeatNewPwd)) {
-                this.AppX.runtimeConfig.toast.show('密码格式错误,密码至少8位,包含英文大小写、数字!');
+                this.AppX.runtimeConfig.toast.show('密码格式错误,密码位数至少12位,必须包含大小写字母和数字,不可包含非法字符!');
                 return;
             }
             if (newPwd === repeatNewPwd) {

+ 6 - 5
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,7 +771,7 @@ 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,}$/)) {
+                        if (!that.checkInput("密码", this.data.password, /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%&+-]{12,}$/, '密码位数至少12位,必须包含大小写字母和数字,不可包含非法字符!')) {
                             return;
                         }
                         // if (!that.verificationHelper.isPhone(this.data.phone, that.toast)) {
@@ -833,7 +833,7 @@ 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,}$/)) {
+                        if (!that.checkInput("密码", this.data.password, /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%&+-]{12,}$/, '密码位数至少12位,必须包含大小写字母和数字,不可包含非法字符!')) {
                             return;
                         }
                         if (!that.checkInput("单位", this.data.deptid)) {
@@ -1027,9 +1027,10 @@ class UserManagement extends BaseWidget {
      * @param title 数据名称
      * @param results 数据
      * @param type 数据类型(选填) 正则表达式
+     * @param errMsg 错误提示
      * @returns 返回true或者false(true正常,false返回数据异常)
      */
-    checkInput(title, results, type?: RegExp) {
+    checkInput(title, results, type?: RegExp, errMsg?: string) {
         if (type == undefined) {
             if (results == undefined || results == null || results == "") {
                 this.toast.show(title + "不能为空")
@@ -1041,7 +1042,7 @@ class UserManagement extends BaseWidget {
             if (type.test(results)) {
                 return results;
             } else {
-                this.toast.show(title + "格式错误")
+                this.toast.show(errMsg || title + "格式错误")
                 return false;
             }
         }