Skip to content

Commit 8662206

Browse files
committed
小程序/APP static_domain处理
1 parent 24f284e commit 8662206

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

models/api.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ var (
1616
)
1717

1818
func initAPI() {
19-
staticDomain = beego.AppConfig.DefaultString("static_domain", "")
20-
if staticDomain != "" {
21-
staticDomain = strings.TrimRight(staticDomain, "/") + "/"
22-
}
2319
if strings.ToLower(utils.StoreType) == utils.StoreOss {
24-
staticDomain = strings.TrimRight(beego.AppConfig.String("oss::Domain"), "/ ") + "/"
20+
staticDomain = strings.TrimSpace(beego.AppConfig.String("oss::Domain"))
21+
}
22+
23+
if strings.TrimRight(staticDomain, "/") == "" {
24+
staticDomain = beego.AppConfig.DefaultString("static_domain", "")
2525
}
26+
27+
staticDomain = strings.TrimRight(staticDomain, "/") + "/"
2628
}
2729

2830
func GetAPIStaticDomain() string {

0 commit comments

Comments
 (0)