代码拉取完成,页面将自动刷新
GoMD/ controllers / page.go
第33行左右
article := models.GetOneArticle(name, "name")
temp := *article
this.Data["id"] = temp[0].Id
这里如果取不到文章,会直接报错可以,做404处理
article := models.GetOneArticle(name, "name")
temp := *article
if len(temp) < 1 {
this.Abort("404")
}
this.Data["id"] = temp[0].Id