Complete logout procedure

pull/9/head
johnniang 6 years ago
parent 2158c12bff
commit b65f545b92

@ -80,7 +80,7 @@ export default {
this.loadOptions() this.loadOptions()
}, },
methods: { methods: {
...mapActions(['Logout']), ...mapActions(['logout']),
...mapGetters(['nickname']), ...mapGetters(['nickname']),
handleLogout() { handleLogout() {
const that = this const that = this
@ -90,7 +90,7 @@ export default {
content: '真的要注销登录吗 ?', content: '真的要注销登录吗 ?',
onOk() { onOk() {
return that return that
.Logout({}) .logout({})
.then(() => { .then(() => {
window.location.reload() window.location.reload()
}) })

@ -21,6 +21,7 @@ router.beforeEach((to, from, next) => {
// TODO Get installation status // TODO Get installation status
next() next()
NProgress.done()
return return
} }
@ -28,12 +29,10 @@ router.beforeEach((to, from, next) => {
// Check whitelist // Check whitelist
if (whiteList.includes(to.name)) { if (whiteList.includes(to.name)) {
next() next()
NProgress.done()
return return
} }
next({ name: 'Login', query: { redirect: to.fullPath } }) next({ name: 'Login', query: { redirect: to.fullPath } })
})
router.afterEach(() => {
NProgress.done() NProgress.done()
}) })

Loading…
Cancel
Save