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 { 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

View File

@ -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('/')
}
}
}