fix: keep type of setting item is correct

pull/1831/head v3.0.2
Noah Hsu 2022-09-25 21:20:32 +08:00
parent 5ac6a30c56
commit f0181d92cd
1 changed files with 3 additions and 2 deletions

View File

@ -43,7 +43,8 @@ func initSettings() {
} else if err != nil {
log.Fatalf("failed get setting: %+v", err)
} else {
err = db.SaveSettingItem(*stored)
v.Value = stored.Value
err = db.SaveSettingItem(v)
if err != nil {
log.Fatalf("failed resave setting: %+v", err)
}
@ -77,7 +78,7 @@ func InitialSettings() []model.SettingItem {
{Key: "pagination_type", Value: "all", Type: conf.TypeSelect, Options: "all,pagination,load_more,auto_load_more", Group: model.SITE},
{Key: "default_page_size", Value: "30", Type: conf.TypeNumber, Group: model.SITE},
// style settings
{Key: conf.Logo, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.STYLE},
{Key: conf.Logo, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeText, Group: model.STYLE},
{Key: conf.Favicon, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.STYLE},
{Key: conf.MainColor, Value: "#1890ff", Type: conf.TypeString, Group: model.STYLE},
{Key: "home_icon", Value: "🏠", Type: conf.TypeString, Group: model.STYLE},