Skip to content

Commit d6eec50

Browse files
committed
调整配置管理页面
1 parent d60e4d4 commit d6eec50

File tree

2 files changed

+403
-333
lines changed

2 files changed

+403
-333
lines changed

controllers/ManagerController.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,20 +639,24 @@ func (this *ManagerController) CreateToken() {
639639
}
640640

641641
func (this *ManagerController) Setting() {
642-
642+
tab := this.GetString("tab", "basic")
643643
options, err := models.NewOption().All()
644644
if err != nil {
645645
this.Abort("404")
646646
}
647647

648648
if this.Ctx.Input.IsPost() {
649649
for _, item := range options {
650-
item.OptionValue = this.GetString(item.OptionName)
651-
item.InsertOrUpdate()
650+
if _, ok := this.Ctx.Request.PostForm[item.OptionName]; ok {
651+
item.OptionValue = this.GetString(item.OptionName)
652+
item.InsertOrUpdate()
653+
}
652654
}
655+
653656
if err := models.NewElasticSearchClient().Init(); err != nil {
654657
this.JsonResult(1, err.Error())
655658
}
659+
656660
models.NewSign().UpdateSignRule()
657661
models.NewReadRecord().UpdateReadingRule()
658662
this.JsonResult(0, "ok")
@@ -667,7 +671,7 @@ func (this *ManagerController) Setting() {
667671
}
668672
}
669673
this.Data["SITE_TITLE"] = this.Option["SITE_NAME"]
670-
674+
this.Data["Tab"] = tab
671675
this.Data["IsSetting"] = true
672676
this.Data["SeoTitle"] = "配置管理"
673677
this.TplName = "manager/setting.html"

0 commit comments

Comments
 (0)