support empty password

pull/548/head
Xhofe 2022-02-15 14:42:24 +08:00
parent 8a219d0732
commit 5c3f91bb55
1 changed files with 5 additions and 1 deletions

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 {