mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-16 15:19:25 +00:00
fix: 请求设置默认org_id
This commit is contained in:
@@ -7,6 +7,7 @@ import { Message, MessageBox } from 'element-ui'
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import axiosRetry from 'axios-retry'
|
import axiosRetry from 'axios-retry'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
import { DEFAULT_ORG_ID } from '@/utils/org'
|
||||||
|
|
||||||
// create an axios instance
|
// create an axios instance
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
@@ -22,7 +23,10 @@ function beforeRequestAddToken(config) {
|
|||||||
}
|
}
|
||||||
const queryOrgId = router.currentRoute.query?.oid
|
const queryOrgId = router.currentRoute.query?.oid
|
||||||
const storeOrgId = store.getters.currentOrg?.id
|
const storeOrgId = store.getters.currentOrg?.id
|
||||||
const orgId = queryOrgId || storeOrgId
|
let orgId = queryOrgId || storeOrgId
|
||||||
|
if (!store.getters.publicSettings?.XPACK_ENABLED) {
|
||||||
|
orgId = DEFAULT_ORG_ID
|
||||||
|
}
|
||||||
if (orgId) {
|
if (orgId) {
|
||||||
config.headers['X-JMS-ORG'] = orgId
|
config.headers['X-JMS-ORG'] = orgId
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user