add settings

This commit is contained in:
微凉
2021-11-12 22:56:30 +08:00
parent 2c675ae909
commit e902c2ded7
4 changed files with 35 additions and 10 deletions

View File

@ -1,10 +1,8 @@
package server
import (
"github.com/Xhofe/alist/conf"
"github.com/Xhofe/alist/model"
"github.com/gofiber/fiber/v2"
"strings"
)
func SaveSettings(ctx *fiber.Ctx) error {
@ -18,10 +16,7 @@ func SaveSettings(ctx *fiber.Ctx) error {
if err := model.SaveSettings(req); err != nil {
return ErrorResp(ctx, err, 500)
} else {
textTypes, err := model.GetSettingByKey("text types")
if err==nil{
conf.TextTypes = strings.Split(textTypes.Value,",")
}
model.LoadSettings()
return SuccessResp(ctx)
}
}