💚 fix dev build

pull/661/head
Xhofe 2022-02-21 21:47:40 +08:00
parent 641ca67671
commit 24058d0c36
1 changed files with 4 additions and 2 deletions

View File

@ -25,8 +25,10 @@ func InitIndex() {
cdnUrl := strings.ReplaceAll(conf.Conf.Assets, "$version", conf.WebTag)
cdnUrl = strings.TrimRight(cdnUrl, "/")
conf.RawIndexHtml = string(data)
if strings.Contains(conf.RawIndexHtml, "CDN_URL") {
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "/CDN_URL", cdnUrl)
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "assets/", cdnUrl+"/assets/")
}
}
func Static(r *gin.Engine) {