完善后端联调链路与模拟器多通道支持
This commit is contained in:
@@ -24,6 +24,10 @@ type Config struct {
|
||||
WechatMiniDevPrefix string
|
||||
LocalEventDir string
|
||||
AssetBaseURL string
|
||||
AssetPublicBaseURL string
|
||||
AssetBucketRoot string
|
||||
OSSUtilPath string
|
||||
OSSUtilConfigFile string
|
||||
}
|
||||
|
||||
func LoadConfigFromEnv() (Config, error) {
|
||||
@@ -44,6 +48,10 @@ func LoadConfigFromEnv() (Config, error) {
|
||||
WechatMiniDevPrefix: getEnv("WECHAT_MINI_DEV_PREFIX", "dev-"),
|
||||
LocalEventDir: getEnv("LOCAL_EVENT_DIR", filepath.Clean("..\\event")),
|
||||
AssetBaseURL: getEnv("ASSET_BASE_URL", "https://oss-mbh5.colormaprun.com/gotomars"),
|
||||
AssetPublicBaseURL: getEnv("ASSET_PUBLIC_BASE_URL", "https://oss-mbh5.colormaprun.com"),
|
||||
AssetBucketRoot: getEnv("ASSET_BUCKET_ROOT", "oss://color-map-html"),
|
||||
OSSUtilPath: getEnv("OSSUTIL_PATH", filepath.Clean("..\\tools\\ossutil.exe")),
|
||||
OSSUtilConfigFile: getEnv("OSSUTIL_CONFIG_FILE", filepath.Join(mustUserHomeDir(), ".ossutilconfig")),
|
||||
}
|
||||
|
||||
if cfg.DatabaseURL == "" {
|
||||
@@ -71,3 +79,11 @@ func getDurationEnv(key string, fallback time.Duration) time.Duration {
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
func mustUserHomeDir() string {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "."
|
||||
}
|
||||
return home
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user