mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-11 19:41:55 +00:00
perf: 修改 tickets orgs (#1691)
* perf: 修改 tickets orgs * perf: 修改 orgs 切换 Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
parent
12a85da6f7
commit
a162a206bc
@ -113,7 +113,13 @@ const actions = {
|
|||||||
commit('SET_MFA_VERIFY')
|
commit('SET_MFA_VERIFY')
|
||||||
},
|
},
|
||||||
changeToView({ commit }, viewName) {
|
changeToView({ commit }, viewName) {
|
||||||
const usingOrgs = state[`${viewName}Orgs`] || state.consoleOrgs
|
const mapper = {
|
||||||
|
console: state.consoleOrgs,
|
||||||
|
audit: state.auditOrgs,
|
||||||
|
workbench: state.workbenchOrgs,
|
||||||
|
tickets: state.consoleOrgs
|
||||||
|
}
|
||||||
|
const usingOrgs = mapper[viewName] || state.consoleOrgs
|
||||||
Vue.$log.debug('Set using orgs: ', viewName, usingOrgs)
|
Vue.$log.debug('Set using orgs: ', viewName, usingOrgs)
|
||||||
commit('SET_USING_ORGS', usingOrgs)
|
commit('SET_USING_ORGS', usingOrgs)
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,7 @@ export function hasActionPerm(route, action) {
|
|||||||
export function getPermedViews() {
|
export function getPermedViews() {
|
||||||
const viewShowMapper = [
|
const viewShowMapper = [
|
||||||
['console', store.getters.consoleOrgs.length > 0],
|
['console', store.getters.consoleOrgs.length > 0],
|
||||||
|
['tickets', store.getters.consoleOrgs.length > 0],
|
||||||
['audit', store.getters.auditOrgs.length > 0],
|
['audit', store.getters.auditOrgs.length > 0],
|
||||||
['workbench', true]
|
['workbench', true]
|
||||||
]
|
]
|
||||||
|
@ -10,7 +10,7 @@ function getPropOrg() {
|
|||||||
if (defaultOrg) {
|
if (defaultOrg) {
|
||||||
return defaultOrg
|
return defaultOrg
|
||||||
}
|
}
|
||||||
return orgs[0]
|
return orgs.filter(item => !item.is_root)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
function change2PropOrg() {
|
function change2PropOrg() {
|
||||||
|
@ -120,7 +120,7 @@ export async function checkUserFirstLogin({ to, from, next }) {
|
|||||||
export async function changeCurrentViewIfNeed({ to, from, next }) {
|
export async function changeCurrentViewIfNeed({ to, from, next }) {
|
||||||
let viewName = to.path.split('/')[1]
|
let viewName = to.path.split('/')[1]
|
||||||
// 这几个是需要检测的, 切换视图组织时,避免 404
|
// 这几个是需要检测的, 切换视图组织时,避免 404
|
||||||
if (['console', 'audit', 'workbench', ''].indexOf(viewName) === -1) {
|
if (['console', 'audit', 'workbench', 'tickets', ''].indexOf(viewName) === -1) {
|
||||||
Vue.$log.debug('Current view no need check', viewName)
|
Vue.$log.debug('Current view no need check', viewName)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user