perf: 修改 view orgs

This commit is contained in:
ibuler
2022-04-19 13:17:42 +08:00
committed by 老广
parent f104376e92
commit 54097f07be
2 changed files with 2 additions and 7 deletions

View File

@@ -93,11 +93,6 @@ const actions = {
modifyOrg({ commit, state }, org) {
commit('MODIFY_ORG', org)
},
setUsingOrgs({ commit, state, rootGetters }) {
const viewName = rootGetters.currentViewRoute.name
const usingOrgs = state[`${viewName}Orgs`] || []
commit('SET_USING_ORGS', usingOrgs)
},
// user logout
logout({ commit, state }) {
return new Promise((resolve, reject) => {
@@ -118,7 +113,7 @@ const actions = {
commit('SET_MFA_VERIFY')
},
changeToView({ commit }, viewName) {
const usingOrgs = state[`${viewName}Orgs`] || []
const usingOrgs = state[`${viewName}Orgs`] || state.consoleOrgs
Vue.$log.debug('Set using orgs: ', viewName, usingOrgs)
commit('SET_USING_ORGS', usingOrgs)
}

View File

@@ -61,7 +61,7 @@ async function changeCurrentOrgIfNeed({ to, from, next }) {
const usingOrgs = store.getters.usingOrgs
if (!usingOrgs || usingOrgs.length === 0) {
Vue.$log.error('No using orgs, return: ', usingOrgs)
Vue.$log.debug('No using orgs, return: ', usingOrgs)
return
}
await refreshCurrentOrg()