diff --git a/src/ui/builder/config/index.js b/src/ui/builder/config/index.js index f6fbcd338f..d1196df4d2 100644 --- a/src/ui/builder/config/index.js +++ b/src/ui/builder/config/index.js @@ -149,7 +149,7 @@ module.exports = { COOKIE_DOMAIN: '{{.cookieDomain}}', COMPONENT_API_URL: '{{.componentApiUrl}}', ENABLE_NOTIFICATION: '{{.enableNotification}}', - BK_REPO_URL: '{{.bkRepoUrl}}' + SHARED_RES_URL: '{{.bkSharedResUrl}}' }), // Template for index.html diff --git a/src/ui/index.html b/src/ui/index.html index 0bdfbee262..1cd7aaf677 100644 --- a/src/ui/index.html +++ b/src/ui/index.html @@ -46,7 +46,7 @@ cookieDomain: <%= htmlWebpackPlugin.options.config.COOKIE_DOMAIN %>, componentApiUrl: <%= htmlWebpackPlugin.options.config.COMPONENT_API_URL %>, enableNotification: <%= htmlWebpackPlugin.options.config.ENABLE_NOTIFICATION %>, - bkRepoUrl: <%= htmlWebpackPlugin.options.config.BK_REPO_URL %> + sharedResUrl: <%= htmlWebpackPlugin.options.config.SHARED_RES_URL %> } window.User = { admin: <%= htmlWebpackPlugin.options.config.USER_ROLE %>, diff --git a/src/ui/src/service/global-config.js b/src/ui/src/service/global-config.js index 23c394ef23..9e89e7d852 100644 --- a/src/ui/src/service/global-config.js +++ b/src/ui/src/service/global-config.js @@ -55,12 +55,12 @@ export const updateConfig = globalConfig => $http.put('admin/update/system_confi * @returns {Object} */ export const getCurrentConfig = async () => { - const { bkRepoUrl } = window.Site + const { sharedResUrl } = window.Site let publicConfigPromise - if (bkRepoUrl) { - const repoUrl = bkRepoUrl.endsWith('/') ? bkRepoUrl : `${bkRepoUrl}/` - publicConfigPromise = getPlatformConfig(`${repoUrl}generic/blueking/bk-config/bk_cmdb/base.js`, initialConfig.publicConfig) + if (sharedResUrl) { + const resUrl = sharedResUrl.endsWith('/') ? sharedResUrl : `${sharedResUrl}/` + publicConfigPromise = getPlatformConfig(`${resUrl}bk_cmdb/base.js`, initialConfig.publicConfig) } else { publicConfigPromise = getPlatformConfig(initialConfig.publicConfig) }