Skip to content

Commit

Permalink
使用bkSharedResUrl替换bkRepoUrl (#8026)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyy authored Jun 13, 2024
1 parent f6085b3 commit 286fcba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ui/builder/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>,
Expand Down
8 changes: 4 additions & 4 deletions src/ui/src/service/global-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 286fcba

Please sign in to comment.