From 2394c8e2b41d7c62f6b01d531feff839a726c88b Mon Sep 17 00:00:00 2001 From: Gucheng Wang Date: Mon, 29 Aug 2022 21:27:47 +0800 Subject: [PATCH] Make sure newStaticBaseUrl is not empty --- conf/conf.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/conf/conf.go b/conf/conf.go index 9f2afd0e..13d2312e 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -28,7 +28,15 @@ func GetConfigString(key string) string { if value, ok := os.LookupEnv(key); ok { return value } - return beego.AppConfig.String(key) + + res := beego.AppConfig.String(key) + if res == "" { + if key == "staticBaseUrl" { + res = "https://cdn.casbin.org" + } + } + + return res } func GetConfigBool(key string) (bool, error) {