From da4f50e1008b815067cf47352747bf6d23b8b043 Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期四, 27 一月 2022 13:58:54 +0800 Subject: [PATCH] bug修复 --- src/pages/desktop/index/components/Tools.vue | 46 ++++++++++++++++++++++++++++++++-------------- 1 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/pages/desktop/index/components/Tools.vue b/src/pages/desktop/index/components/Tools.vue index 6ef8db8..be2bd4a 100644 --- a/src/pages/desktop/index/components/Tools.vue +++ b/src/pages/desktop/index/components/Tools.vue @@ -120,6 +120,7 @@ :visible.sync="showPasswdForm" :append-to-body="true" width="500px" + @close="cancelPasswordChange" > <el-form :model="passwdForm" @@ -153,7 +154,7 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button type="info" @click="showPasswdForm = false" size="small" + <el-button type="info" size="small" @click="cancelPasswordChange" >鍙� 娑�</el-button > <el-button type="primary" @click="submitForm('ruleForm')" size="small" @@ -343,7 +344,7 @@ }, mounted() { document.addEventListener("click", (e) => { - if (this.showFastPath||this.showWifi) { + if (this.showFastPath || this.showWifi) { this.showFastPath = false; this.showWifi = false; } @@ -384,10 +385,7 @@ ); }, updateSysNow() { - window.parent.postMessage( - { msg: `toVindicate?autoUpdate=1` }, - "*" - ); + window.parent.postMessage({ msg: `toVindicate?autoUpdate=1` }, "*"); }, delaySysRemind(sec) { delayUpgradeNotice({ @@ -436,7 +434,12 @@ }); }, toggleShowWifi() { + this.notificationCenterVisible = false; this.showWifi = !this.showWifi; + this.$store.commit( + "desktop/changeNotificationCenterVisible", + this.notificationCenterVisible + ); }, submitForm(formName) { this.$refs[formName].validate((valid) => { @@ -445,15 +448,22 @@ oldPwd: this.passwdForm.oldPwd, newPwd: this.passwdForm.checkPwd, }; - updatePwd(json).then((res) => { - this.$notify({ - type: res.success ? "success" : "error", - message: res.msg, + updatePwd(json) + .then((res) => { + this.$notify({ + type: res.success ? "success" : "error", + message: res.msg, + }); + if (res.success) { + this.cancelPasswordChange(); + } + }) + .catch((err) => { + this.$notify({ + type: "error", + message: err.msg, + }); }); - if (res.success) { - this.showPasswdForm = false; - } - }); } else { console.log("error submit!!"); return false; @@ -537,6 +547,14 @@ console.log("閫�鍑哄け璐�"); }); }, + cancelPasswordChange() { + this.showPasswdForm = false; + this.passwdForm = { + oldPwd: "", + newPwd: "", + checkPwd: "", + }; + }, }, }; </script> -- Gitblit v1.8.0