zhaoke 1 рік тому
батько
коміт
5b743eb6bc
2 змінених файлів з 20 додано та 14 видалено
  1. 1 1
      src/layout/index.vue
  2. 19 13
      src/views/newUserManagement/index.vue

+ 1 - 1
src/layout/index.vue

@@ -180,7 +180,7 @@ export default {
             this.outQd()
           }, 2000)
         } else {
-          this.$message.error(res.message ?? '失败')
+          this.$message.error(res.message ?? '旧密码输入错误')
         }
       } catch (error) {
         this.$message.error('失败')

+ 19 - 13
src/views/newUserManagement/index.vue

@@ -520,22 +520,28 @@ export default {
           } else {
             const id = this.ruleForm.user_group_id || this.ruleForm.user_id
             if (id) {
-              this.ruleForm.user_pwd = MD5(this.ruleForm.user_pwd)
-              const data = _.cloneDeep(this.ruleForm)
-              if (data.user_group_id) {
-                delete data.user_group_id
+              const r = PLATFROM_CONFIG.editRule
+              const b = r.test(this.ruleForm.user_pwd)
+              if (b) {
+                this.ruleForm.user_pwd = MD5(this.ruleForm.user_pwd)
+                const data = _.cloneDeep(this.ruleForm)
+                if (data.user_group_id) {
+                  delete data.user_group_id
+                }
+                const { code } = await this.getChangeList(SERVICE_ID.getUserTableId, data, 2, 'user_id')
+                this.tipMsg(code)
+                const result = await this.getQueryList(SERVICE_ID.getUserTableId, {
+                  up_user_group_id: this.treeCheckObj.user_group_id
+                })
+                this.tableData = result.returnData
+                this.clearTableForm()
+                this.tableFlag = false
+                this.paswordFlag = false
+              } else {
+                this.$message.error('请根据密码规则设置密码')
               }
-              const { code } = await this.getChangeList(SERVICE_ID.getUserTableId, data, 2, 'user_id')
-              this.tipMsg(code)
             }
           }
-          const result = await this.getQueryList(SERVICE_ID.getUserTableId, {
-            up_user_group_id: this.treeCheckObj.user_group_id
-          })
-          this.tableData = result.returnData
-          this.clearTableForm()
-          this.tableFlag = false
-          this.paswordFlag = false
         }
         else {
           return false