Commit bac0cea6 authored by wangxl's avatar wangxl

222

parent 3551c2a7
...@@ -317,7 +317,7 @@ export function changeSystemType (type) { ...@@ -317,7 +317,7 @@ export function changeSystemType (type) {
try { try {
this.$store.commit('app/clearStore') this.$store.commit('app/clearStore')
setType(type + '') setType(type + '')
await store.dispatch('user/logout') await store.dispatch('user/getMenuList')
this.$store.commit('app/setSystemType', type) this.$store.commit('app/setSystemType', type)
this.$router.push('/') this.$router.push('/')
resolve(true) resolve(true)
......
...@@ -51,13 +51,14 @@ const actions = { ...@@ -51,13 +51,14 @@ const actions = {
}) })
}, },
logout ({ dispatch }) { logout ({ dispatch }) {
_this = this
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
this.$message.error('登录信息失效,请重新登录!') _this.$message.error('登录信息失效,请重新登录!')
this.$api.base.logout().then(({ data }) => { }).catch(() => { }) _this.$api.base.logout().then(({ data }) => { }).catch(() => { })
removeToken() removeToken()
window.sessionStorage.clear() window.sessionStorage.clear()
this.$store.commit('app/clearStore') _this.$store.commit('app/clearStore')
this.$router.push(`/login`) _this.$router.push(`/login`)
}) })
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment