退出功能
This commit is contained in:
@@ -13,9 +13,7 @@ export default new Vuex.Store({
|
||||
mallName: '',
|
||||
mallList: [],
|
||||
activeDlgShow: false,
|
||||
userInfo: {},
|
||||
routes: [],
|
||||
addRoutes: []
|
||||
userInfo: {}
|
||||
},
|
||||
|
||||
mutations: {
|
||||
@@ -31,13 +29,16 @@ export default new Vuex.Store({
|
||||
setMallList (state, mallList) {
|
||||
state.mallList = mallList
|
||||
},
|
||||
SignOut (state) {
|
||||
logout (state) {
|
||||
state.token = ''
|
||||
state.userInfo = {}
|
||||
state.userInfo = {}
|
||||
state.mallList = []
|
||||
state.mallName = ''
|
||||
state.mallId = ''
|
||||
|
||||
setTimeout(() => {
|
||||
router.push('/login')
|
||||
}, 600)
|
||||
}, 200)
|
||||
},
|
||||
|
||||
setUserInfo (state, userInfo) {
|
||||
@@ -58,7 +59,20 @@ export default new Vuex.Store({
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
SignOut (store, isClear) {
|
||||
if (isClear) {
|
||||
store.commit('logout')
|
||||
return false
|
||||
}
|
||||
|
||||
request.post('/api/token/logout').then(res => {
|
||||
if (res.code === 0) {
|
||||
store.commit('logout')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
getters: {
|
||||
|
||||
Reference in New Issue
Block a user