From 50579fef84ac9048467f1826bc088e949dd28aa5 Mon Sep 17 00:00:00 2001 From: Andy Hsu Date: Tue, 21 Feb 2023 19:45:09 +0800 Subject: [PATCH] fix: cancel api replace to avoid missing host --- server/static/config.go | 2 -- server/static/static.go | 1 - 2 files changed, 3 deletions(-) diff --git a/server/static/config.go b/server/static/config.go index af1910b6840..7a8250a9046 100644 --- a/server/static/config.go +++ b/server/static/config.go @@ -8,14 +8,12 @@ import ( ) type SiteConfig struct { - ApiURL string BasePath string Cdn string } func getSiteConfig() SiteConfig { siteConfig := SiteConfig{ - ApiURL: conf.Conf.SiteURL, BasePath: conf.URL.Path, Cdn: strings.ReplaceAll(strings.TrimSuffix(conf.Conf.Cdn, "/"), "$version", conf.WebVersion), } diff --git a/server/static/static.go b/server/static/static.go index a422e15286b..be1db2c6fa5 100644 --- a/server/static/static.go +++ b/server/static/static.go @@ -29,7 +29,6 @@ func InitIndex() { replaceMap := map[string]string{ "cdn: undefined": fmt.Sprintf("cdn: '%s'", siteConfig.Cdn), "base_path: undefined": fmt.Sprintf("base_path: '%s'", siteConfig.BasePath), - "api: undefined": fmt.Sprintf("api: '%s'", siteConfig.ApiURL), } for k, v := range replaceMap { conf.RawIndexHtml = strings.Replace(conf.RawIndexHtml, k, v, 1)