From c645664d26367983498bee73dde0d115e60f234c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 29 Apr 2022 16:49:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=90=8E=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/user/index.vue | 9 +++++++-- frontend/src/views/system/user/personPwd.vue | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/system/user/index.vue b/frontend/src/views/system/user/index.vue index c8272a8227..a3614a0081 100644 --- a/frontend/src/views/system/user/index.vue +++ b/frontend/src/views/system/user/index.vue @@ -183,7 +183,7 @@ import { pluginLoaded } from '@/api/user' /* import { ldapStatus, pluginLoaded } from '@/api/user' */ import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user' import { getDeptTree, treeByDeptId } from '@/api/system/dept' - +import { mapGetters } from 'vuex' export default { components: { ComplexTable, LayoutContent, Treeselect }, @@ -320,6 +320,11 @@ export default { canLoadDom: false } }, + computed: { + ...mapGetters([ + 'user' + ]) + }, mounted() { this.allRoles() this.search() @@ -420,7 +425,7 @@ export default { this.$success(this.$t('commons.modify_success')) this.editPasswordVisible = false this.search() - window.location.reload() + this.user && this.user.userId && (this.user.userId === editPasswordForm.userId) && window.location.reload() }) } else { return false diff --git a/frontend/src/views/system/user/personPwd.vue b/frontend/src/views/system/user/personPwd.vue index e6d26c116c..5a5e9f4385 100644 --- a/frontend/src/views/system/user/personPwd.vue +++ b/frontend/src/views/system/user/personPwd.vue @@ -85,12 +85,17 @@ export default { } updatePersonPwd(param).then(res => { this.$success(this.$t('commons.save_success')) - this.$router.push('/panel/index') + this.logout() + // this.$router.push('/panel/index') }) } else { return false } }) + }, + async logout() { + await this.$store.dispatch('user/logout') + this.$router.push('/') } } }