@@ -10,7 +10,6 @@ import (
1010 "github.com/alist-org/alist/v3/cmd/flags"
1111 "github.com/alist-org/alist/v3/internal/conf"
1212 "github.com/alist-org/alist/v3/internal/setting"
13- "github.com/alist-org/alist/v3/pkg/utils"
1413 "github.com/alist-org/alist/v3/public"
1514 "github.com/gin-gonic/gin"
1615 log "github.com/sirupsen/logrus"
@@ -26,16 +25,7 @@ func InitIndex() {
2625}
2726
2827func UpdateIndex () {
29- cdn := strings .TrimSuffix (conf .Conf .Cdn , "/" )
30- cdn = strings .ReplaceAll (cdn , "$version" , conf .WebVersion )
31- basePath := setting .GetStr (conf .BasePath )
32- if basePath != "" {
33- basePath = utils .StandardizePath (basePath )
34- }
35- if cdn == "" {
36- cdn = basePath
37- }
38- apiUrl := setting .GetStr (conf .ApiUrl )
28+ siteConfig := getSiteConfig ()
3929 favicon := setting .GetStr (conf .Favicon )
4030 title := setting .GetStr (conf .SiteTitle )
4131 customizeHead := setting .GetStr (conf .CustomizeHead )
@@ -45,9 +35,9 @@ func UpdateIndex() {
4535 replaceMap1 := map [string ]string {
4636 "https://jsd.nn.ci/gh/alist-org/logo@main/logo.svg" : favicon ,
4737 "Loading..." : title ,
48- "cdn: undefined" : fmt .Sprintf ("cdn: '%s'" , cdn ),
49- "base_path: undefined" : fmt .Sprintf ("base_path: '%s'" , basePath ),
50- "api: undefined" : fmt .Sprintf ("api: '%s'" , apiUrl ),
38+ "cdn: undefined" : fmt .Sprintf ("cdn: '%s'" , siteConfig . Cdn ),
39+ "base_path: undefined" : fmt .Sprintf ("base_path: '%s'" , siteConfig . BasePath ),
40+ "api: undefined" : fmt .Sprintf ("api: '%s'" , siteConfig . ApiURL ),
5141 "main_color: undefined" : fmt .Sprintf ("main_color: '%s'" , mainColor ),
5242 }
5343 for k , v := range replaceMap1 {
0 commit comments