Explorar el Código

修改账号密码提交

zhaoke hace 2 años
padre
commit
5a7425f3b6
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      src/views/accountManagement/components/accountHome.vue

+ 6 - 2
src/views/accountManagement/components/accountHome.vue

@@ -154,7 +154,8 @@ export default {
       },
       ruleFormObj: {},
       roleId: '',
-      msgIndex: null
+      msgIndex: null,
+      oldPwd: ''
     }
   },
   computed: {
@@ -201,7 +202,9 @@ export default {
     // 编辑账号
     async saveEditAccount () {
       try {
-        this.ruleForm.user_pwd = MD5(this.ruleForm.user_pwd)
+        if (this.oldPwd !== this.ruleForm.user_pwd) {
+          this.ruleForm.user_pwd = MD5(this.ruleForm.user_pwd)
+        }
         const res = await GeneralDataReception({
           serviceId: SERVICE_ID.accountScId,
           dataContent: JSON.stringify(this.ruleForm)
@@ -246,6 +249,7 @@ export default {
         const { listValues } = res.returnData
         const obj = listValues[0]
         this.ruleForm = obj
+        this.oldPwd = obj.user_pwd
         this.ruleForm.event = 2
       } else {
         this.$message.error(res.message)