fix: 修改密码后退出登录

This commit is contained in:
fit2cloud-chenyw 2022-04-29 16:49:00 +08:00
parent 2d0dd59345
commit c645664d26
2 changed files with 13 additions and 3 deletions

View File

@ -183,7 +183,7 @@ import { pluginLoaded } from '@/api/user'
/* import { ldapStatus, pluginLoaded } from '@/api/user' */ /* import { ldapStatus, pluginLoaded } from '@/api/user' */
import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user' import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user'
import { getDeptTree, treeByDeptId } from '@/api/system/dept' import { getDeptTree, treeByDeptId } from '@/api/system/dept'
import { mapGetters } from 'vuex'
export default { export default {
components: { ComplexTable, LayoutContent, Treeselect }, components: { ComplexTable, LayoutContent, Treeselect },
@ -320,6 +320,11 @@ export default {
canLoadDom: false canLoadDom: false
} }
}, },
computed: {
...mapGetters([
'user'
])
},
mounted() { mounted() {
this.allRoles() this.allRoles()
this.search() this.search()
@ -420,7 +425,7 @@ export default {
this.$success(this.$t('commons.modify_success')) this.$success(this.$t('commons.modify_success'))
this.editPasswordVisible = false this.editPasswordVisible = false
this.search() this.search()
window.location.reload() this.user && this.user.userId && (this.user.userId === editPasswordForm.userId) && window.location.reload()
}) })
} else { } else {
return false return false

View File

@ -85,12 +85,17 @@ export default {
} }
updatePersonPwd(param).then(res => { updatePersonPwd(param).then(res => {
this.$success(this.$t('commons.save_success')) this.$success(this.$t('commons.save_success'))
this.$router.push('/panel/index') this.logout()
// this.$router.push('/panel/index')
}) })
} else { } else {
return false return false
} }
}) })
},
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push('/')
} }
} }
} }