mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-07 18:08:50 +00:00
Compare commits
1 Commits
v4.10.11
...
pr@dev@fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a806caefd |
@@ -99,8 +99,11 @@ export default {
|
||||
},
|
||||
currentOrgId() {
|
||||
const usingOrgIds = this.usingOrgs.map(o => o.id)
|
||||
|
||||
let currentOrgId = this.currentOrg.id
|
||||
|
||||
const find = usingOrgIds.indexOf(currentOrgId) > -1
|
||||
|
||||
if (!find) {
|
||||
currentOrgId = null
|
||||
}
|
||||
|
||||
@@ -148,11 +148,11 @@ const actions = {
|
||||
}
|
||||
commit('SET_CURRENT_ORG', systemOrg)
|
||||
},
|
||||
leaveSettingOrg({ commit }) {
|
||||
const preOrg = store.state.users.preOrg
|
||||
if (!preOrg) {
|
||||
return
|
||||
}
|
||||
leaveSettingOrg({ commit, state }) {
|
||||
const preOrg = getPreOrgLocal(state.profile.username)
|
||||
|
||||
if (!preOrg) return
|
||||
|
||||
commit('SET_CURRENT_ORG', preOrg)
|
||||
},
|
||||
enterGlobalOrg({ commit }) {
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
<script>
|
||||
import Layout from '@/layout'
|
||||
import store from '@/store'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { setPreOrgLocal } from '@/utils/auth'
|
||||
import { GLOBAL_ORG_ID } from '@/utils/org'
|
||||
|
||||
export default {
|
||||
name: 'Setting',
|
||||
extends: Layout,
|
||||
computed: {
|
||||
...mapGetters(['currentOrg'])
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
store.dispatch('users/enterSettingOrg').then(() => next())
|
||||
next(vm => {
|
||||
if (vm.currentOrg.id === GLOBAL_ORG_ID) {
|
||||
const currentUser = vm.$store.state.users.username
|
||||
|
||||
setPreOrgLocal(currentUser, vm.currentOrg)
|
||||
}
|
||||
|
||||
store.dispatch('users/enterSettingOrg').then(() => next())
|
||||
})
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
store.dispatch('users/leaveSettingOrg').then(() => next())
|
||||
|
||||
Reference in New Issue
Block a user