| | |
| | | }, |
| | | |
| | | // user logout |
| | | logout({ commit, state }) { |
| | | logout({ commit, state, dispatch }) { |
| | | return new Promise((resolve, reject) => { |
| | | const usercode = getCookie('navTabId') |
| | | const username = getCookie('admin') |
| | |
| | | removeCookie('navTabId') |
| | | removeCookie('usertype') |
| | | removeCookie('userid') |
| | | } |
| | | commit('RESET_STATE') |
| | | |
| | | resolve() |
| | | // reset visited views and cached views |
| | | dispatch('tagsView/delAllViews', null, { root: true }) |
| | | sessionStorage.removeItem('tabViews') |
| | | |
| | | commit('RESET_STATE') |
| | | |
| | | resolve() |
| | | } |
| | | }).catch(error => { |
| | | reject(error) |
| | | }) |