【update】-token过期 退出登录的时候 不调用接口

This commit is contained in:
fengchenchen
2023-08-24 09:06:04 +08:00
parent 9de29dfdb9
commit 0c496c9e8a
5 changed files with 25 additions and 6 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ export const JeroListMixin = {
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
store.dispatch('LogoutNotRequest').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
+2 -2
View File
@@ -42,7 +42,7 @@ const err = (error) => {
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
store.dispatch('LogoutNotRequest').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
try {
let path = window.document.location.pathname
@@ -149,7 +149,7 @@ function blobToJson(data) {
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
store.dispatch('LogoutNotRequest').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
+19
View File
@@ -185,6 +185,25 @@ const user = {
})
})
},
// 登出 不调用接口
LogoutNotRequest({ commit, state }) {
return new Promise((resolve) => {
commit('SET_TOKEN', '')
commit('SET_PERMISSIONLIST', [])
Vue.ls.remove(ACCESS_TOKEN)
Vue.ls.remove(USER_INFO)
Vue.ls.remove(USER_NAME)
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
Vue.ls.remove(CACHE_INCLUDED_ROUTES)
if (process.env.VUE_APP_SSO == 'true') {
let sevice = 'http://' + window.location.host + '/'
let serviceUrl = encodeURIComponent(sevice)
window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl
}
resolve()
})
},
// 第三方登录
ThirdLogin({ commit }, param) {
return new Promise((resolve, reject) => {
+2 -2
View File
@@ -49,7 +49,7 @@ const err = (error) => {
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
store.dispatch('LogoutNotRequest').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
try {
let path = window.document.location.pathname
@@ -147,7 +147,7 @@ function blobToJson(data) {
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
store.dispatch('LogoutNotRequest').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
@@ -441,7 +441,7 @@ export default {
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
store.dispatch('LogoutNotRequest').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})