mirror of
https://github.com/jumpserver/lina.git
synced 2025-07-08 12:43:56 +00:00
Merge pull request #1223 from jumpserver/pr@dev@ticket_perf
perf: 默认展示当前组织
This commit is contained in:
commit
744acee097
@ -218,8 +218,15 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$store.state.users.profile.user_all_orgs.length > 0) {
|
||||
this.initial.org_id = this.$store.state.users.profile.user_all_orgs[0].id
|
||||
let userAllOrgIds = this.$store.state.users.profile['user_all_orgs']
|
||||
const currentOrgId = this.$store.getters.currentOrg.id
|
||||
userAllOrgIds = userAllOrgIds ? userAllOrgIds.map(i => i.id) : []
|
||||
if (userAllOrgIds.length > 0) {
|
||||
if (userAllOrgIds.includes(currentOrgId)) {
|
||||
this.initial.org_id = currentOrgId
|
||||
} else {
|
||||
this.initial.org_id = userAllOrgIds[0]
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
},
|
||||
|
@ -130,8 +130,15 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$store.state.users.profile['user_all_orgs'].length > 0) {
|
||||
this.initial.org_id = this.$store.state.users.profile['user_all_orgs'][0].id
|
||||
let userAllOrgIds = this.$store.state.users.profile['user_all_orgs']
|
||||
const currentOrgId = this.$store.getters.currentOrg.id
|
||||
userAllOrgIds = userAllOrgIds ? userAllOrgIds.map(i => i.id) : []
|
||||
if (userAllOrgIds.length > 0) {
|
||||
if (userAllOrgIds.includes(currentOrgId)) {
|
||||
this.initial.org_id = currentOrgId
|
||||
} else {
|
||||
this.initial.org_id = userAllOrgIds[0]
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user