diff --git a/projects/Platform/wwwroot/js/axios.js b/projects/Platform/wwwroot/js/axios.js index b5caf2b4..8b8d9460 100644 --- a/projects/Platform/wwwroot/js/axios.js +++ b/projects/Platform/wwwroot/js/axios.js @@ -24,7 +24,7 @@ axios.interceptors.response.use(function (response) { console.error(error); if (error.response) { if (error.response.status === 401) { - if (store.state.token.refreshToken) { + if (store.state.token.refreshToken && error.config.url.indexOf('refreshToken') > -1) { var url = config.service('platform/api/v1/token/refreshToken') var data = '"' + store.state.token.refreshToken + '"'; return axios.post(url, data, { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }) @@ -46,6 +46,7 @@ axios.interceptors.response.use(function (response) { }); } else { + store.commit('logout', response.data); router.push('components/views/areas/default/login.vue'); } }