fix(cdn): fix cdn replace
This commit is contained in:
@@ -517,6 +517,9 @@ func (tc *TemplateController) html(ctx *gin.Context, code int, tpl string, siteI
|
||||
})
|
||||
|
||||
if prefix != "" {
|
||||
if prefix[len(prefix)-1:] == "/" {
|
||||
prefix = strings.TrimSuffix(prefix, "/")
|
||||
}
|
||||
cssPath = prefix + tc.cssPath
|
||||
for i, path := range tc.scriptPath {
|
||||
scriptPath[i] = prefix + path
|
||||
|
||||
@@ -148,6 +148,9 @@ func (a *UIRouter) Register(r *gin.Engine, baseURLPath string) {
|
||||
return nil
|
||||
})
|
||||
if cdnPrefix != "" {
|
||||
if cdnPrefix[len(cdnPrefix)-1:] == "/" {
|
||||
cdnPrefix = strings.TrimSuffix(cdnPrefix, "/")
|
||||
}
|
||||
c.String(http.StatusOK, strings.ReplaceAll(string(file), "/static", cdnPrefix+"/static"))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user