✨ add settings
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user