mirror of https://github.com/Xhofe/alist
fix: cancel api replace to avoid missing host
parent
e39299bfe2
commit
50579fef84
|
@ -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),
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue