add usualConfig

This commit is contained in:
wangchuxiao
2022-11-10 18:23:11 +08:00
parent 1c528b0f04
commit 08f3a79e6e
3 changed files with 34 additions and 9 deletions
+21 -3
View File
@@ -589,17 +589,24 @@ type usualConfig struct {
} `yaml:"minio"`
} `yaml:"credential"`
Secret string `yaml:"secret"`
Tokenpolicy struct {
AccessSecret string `yaml:"accessSecret"`
AccessExpire int64 `yaml:"accessExpire"`
} `yaml:"tokenpolicy"`
Messageverify struct {
FriendVerify bool `yaml:"friendVerify"`
}
} `yaml:"messageverify"`
Push struct {
Getui struct {
MasterSecret string `yaml:"masterSecret"`
AppKey string `yaml:"appKey"`
Enable bool `yaml:"enable"`
}
}
} `yaml:"getui"`
} `yaml:"push"`
}
var UsualConfig usualConfig
@@ -697,4 +704,15 @@ func init() {
Config.Push.Getui.Enable = &UsualConfig.Push.Getui.Enable
}
if Config.Secret == "" {
Config.Secret = UsualConfig.Secret
}
if Config.TokenPolicy.AccessExpire == 0 {
Config.TokenPolicy.AccessExpire = UsualConfig.Tokenpolicy.AccessExpire
}
if Config.TokenPolicy.AccessSecret == "" {
Config.TokenPolicy.AccessSecret = UsualConfig.Tokenpolicy.AccessSecret
}
}