From 286fcbab0f71b8c8955d0516e81c179233952554 Mon Sep 17 00:00:00 2001 From: yangyy Date: Thu, 13 Jun 2024 20:25:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8bkSharedResUrl=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2bkRepoUrl=20(#8026)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/builder/config/index.js | 2 +- src/ui/index.html | 2 +- src/ui/src/service/global-config.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) 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) }