Browse Source

fix:修复备案号错误

lifei6671 7 years ago
parent
commit
a9a4018711
2 changed files with 3 additions and 7 deletions
  1. 2 6
      controllers/BaseController.go
  2. 1 1
      views/widgets/footer.tpl

+ 2 - 6
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")

+ 1 - 1
views/widgets/footer.tpl

@@ -9,7 +9,7 @@
             <span>&nbsp;·&nbsp;</span>
             <span><a href="https://www.iminho.me/wiki/docs/mindoc/" target="_blank">使用手册</a></span>
         </div>
-        {{if ne .site_beian ""}}
+        {{if .site_beian}}
         <div class="row text-center">
             <a href="http://www.miitbeian.gov.cn" target="_blank">{{.site_beian}}</a>
         </div>