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