mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 01:11:07 +00:00
perf: revert pre org if logout
This commit is contained in:
@@ -61,7 +61,6 @@ export default {
|
|||||||
break
|
break
|
||||||
case 'logout':
|
case 'logout':
|
||||||
this.logout()
|
this.logout()
|
||||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
|
||||||
break
|
break
|
||||||
case 'apiKey':
|
case 'apiKey':
|
||||||
this.$router.push('/profile/api-keys')
|
this.$router.push('/profile/api-keys')
|
||||||
@@ -73,7 +72,12 @@ export default {
|
|||||||
this.$router.push('/profile/user/setting')
|
this.$router.push('/profile/user/setting')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logout() {
|
async logout() {
|
||||||
|
const currentOrg = this.$store.getters.currentOrg
|
||||||
|
if (currentOrg.autoEnter) {
|
||||||
|
await this.$store.dispatch('users/setCurrentOrg', this.$store.getters.preOrg)
|
||||||
|
}
|
||||||
|
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,9 @@ async function checkLogin({ to, from, next }) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
Vue.$log.error(e)
|
Vue.$log.error(e)
|
||||||
const status = e.response.status
|
const status = e.response.status
|
||||||
|
if (store.getters.currentOrg.autoEnter) {
|
||||||
|
await store.dispatch('users/setCurrentOrg', store.getters.preOrg)
|
||||||
|
}
|
||||||
if (status === 401 || status === 403) {
|
if (status === 401 || status === 403) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||||
|
Reference in New Issue
Block a user