🎇 support add another alist

This commit is contained in:
微凉
2021-12-07 20:16:34 +08:00
parent 74d8fa3919
commit 985b81826f
8 changed files with 37 additions and 17 deletions

View File

@ -1,7 +1,9 @@
package model
import (
"fmt"
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/utils"
"strings"
)
@ -83,6 +85,11 @@ func LoadSettings() {
conf.IndexHtml = strings.Replace(conf.IndexHtml, "<!-- customize body -->", customizeBody.Value, 1)
}
adminPassword, err := GetSettingByKey("password")
if err == nil {
conf.Token = utils.GetMD5Encode(fmt.Sprintf("https://github.com/Xhofe/alist-%s",adminPassword.Value))
}
davUsername, err := GetSettingByKey("WebDAV username")
if err == nil {
conf.DavUsername = davUsername.Value