support empty password

This commit is contained in:
Xhofe 2022-02-15 14:42:24 +08:00
parent 8a219d0732
commit 5c3f91bb55

View File

@ -114,7 +114,11 @@ func LoadSettings() {
// token
adminPassword, err := GetSettingByKey("password")
if err == nil {
conf.Token = utils.GetMD5Encode(fmt.Sprintf("https://github.com/Xhofe/alist-%s", adminPassword.Value))
if adminPassword.Value != "" {
conf.Token = utils.GetMD5Encode(fmt.Sprintf("https://github.com/Xhofe/alist-%s", adminPassword.Value))
} else {
conf.Token = ""
}
}
// load settings
for _, key := range conf.LoadSettings {