mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-25 22:44:13 +00:00
fix: 修复自动切换到 root org 回不来的问题
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { getProfile as apiGetProfile, logout } from '@/api/users'
|
||||
import { getCurrentOrgLocal, getPreOrgLocal, getTokenFromCookie, saveCurrentOrgLocal, setPreOrgLocal } from '@/utils/auth'
|
||||
import {
|
||||
getCurrentOrgLocal, getPreOrgLocal, getTokenFromCookie, saveCurrentOrgLocal, setPreOrgLocal
|
||||
} from '@/utils/auth'
|
||||
import orgUtil from '@/utils/org'
|
||||
import { resetRouter } from '@/router'
|
||||
import Vue from 'vue'
|
||||
@@ -157,6 +159,7 @@ const actions = {
|
||||
const globalOrg = {
|
||||
id: orgUtil.GLOBAL_ORG_ID,
|
||||
name: 'Global',
|
||||
is_root: true,
|
||||
autoEnter: true
|
||||
}
|
||||
commit('SET_CURRENT_ORG', globalOrg)
|
||||
|
||||
@@ -65,6 +65,12 @@ async function changeCurrentOrgIfNeed({ to, from, next }) {
|
||||
await orgUtil.changeOrg(preOrg)
|
||||
return
|
||||
}
|
||||
if (currentOrg.is_root && !currentOrg.autoEnter) {
|
||||
setTimeout(() => {
|
||||
orgUtil.change2PropOrg({ to, from, next })
|
||||
}, 1000)
|
||||
return
|
||||
}
|
||||
if (!orgUtil.hasCurrentOrgPermission()) {
|
||||
Vue.$log.error('Not has current org permission: ', currentOrg)
|
||||
await orgUtil.change2PropOrg({ to, from, next })
|
||||
|
||||
Reference in New Issue
Block a user