From 5e12795b0cc976def5b6aa96a09e37578f2a95e2 Mon Sep 17 00:00:00 2001 From: supertiger1234 Date: Tue, 13 Aug 2019 13:37:16 +0100 Subject: [PATCH] clear local storage when logging out. --- src/store/modules/userModule.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/userModule.js b/src/store/modules/userModule.js index c773859..427a7e8 100644 --- a/src/store/modules/userModule.js +++ b/src/store/modules/userModule.js @@ -30,6 +30,8 @@ const actions = { context.commit('user', user) }, logout(context) { + axios.defaults.headers.common['authorization'] = ""; + localStorage.clear() context.commit('logout'); }, changeStatus(context, status) { @@ -66,8 +68,6 @@ const mutations = { state.token = token }, logout(state) { - axios.defaults.headers.common['authorization'] = ""; - localStorage.removeItem('hauthid') state.user = null, state.token = null; },