Skip to content

Commit

Permalink
feat: add frontend bkcc host variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AlkaidChan committed Oct 28, 2023
1 parent 50622a8 commit f8f52f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions bcs-services/bcs-bscp/cmd/ui/service/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (s *WebServer) subRouter() http.Handler {
SiteURL: config.G.Web.RoutePrefix,
APIURL: config.G.Frontend.Host.BSCPAPIURL,
IAMHost: config.G.Frontend.Host.BKIAMHost,
CMDBHost: config.G.Frontend.Host.BKCMDBHost,
}

if shouldProxyAPI {
Expand Down
2 changes: 2 additions & 0 deletions bcs-services/bcs-bscp/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type IndexConfig struct {
RunEnv string
StaticURL string
IAMHost string
CMDBHost string
APIURL string
SiteURL string // vue 路由前缀
ProxyAPI bool
Expand Down Expand Up @@ -158,6 +159,7 @@ func (e *EmbedWeb) RenderIndexHandler(conf *IndexConfig) http.Handler {
"RUN_ENV": conf.RunEnv,
"BK_BCS_BSCP_API": conf.APIURL,
"BK_IAM_HOST": conf.IAMHost,
"BK_CC_HOST": conf.CMDBHost,
"BK_BSCP_CONFIG": bscpConfig,
"SITE_URL": conf.SiteURL,
}
Expand Down
1 change: 1 addition & 0 deletions bcs-services/bcs-bscp/pkg/config/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package config
// HostConf host conf
type HostConf struct {
BKIAMHost string `yaml:"bk_iam_host"` // 权限中心
BKCMDBHost string `yaml:"bk_cmdb_host"` // 配置平台
BSCPAPIURL string `yaml:"bscp_api_url"` // bscp api地址
}

Expand Down

0 comments on commit f8f52f9

Please sign in to comment.