diff --git a/controllers/BaseController.go b/controllers/BaseController.go index e17e29c7..ebc09016 100644 --- a/controllers/BaseController.go +++ b/controllers/BaseController.go @@ -68,12 +68,8 @@ func (c *BaseController) Prepare() { c.Data[item.OptionName] = item.OptionValue c.Option[item.OptionName] = item.OptionValue - if strings.EqualFold(item.OptionName, "ENABLE_ANONYMOUS") && item.OptionValue == "true" { - c.EnableAnonymous = true - } - if strings.EqualFold(item.OptionName, "ENABLE_DOCUMENT_HISTORY") && item.OptionValue == "true" { - c.EnableDocumentHistory = true - } + c.EnableAnonymous = strings.EqualFold(item.OptionName, "ENABLE_ANONYMOUS") && item.OptionValue == "true" + c.EnableDocumentHistory = strings.EqualFold(item.OptionName, "ENABLE_DOCUMENT_HISTORY") && item.OptionValue == "true" } } c.Data["HighlightStyle"] = beego.AppConfig.DefaultString("highlight_style","github") diff --git a/views/widgets/footer.tpl b/views/widgets/footer.tpl index 7f077d8f..5c880d4e 100644 --- a/views/widgets/footer.tpl +++ b/views/widgets/footer.tpl @@ -9,7 +9,7 @@ · 使用手册 - {{if ne .site_beian ""}} + {{if .site_beian}}