34 Star 188 Fork 56

xuthus / GoMD

 / 详情

取不到文章,404处理

待办的
创建于  
2020-02-24 22:29

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

评论 (1)

Jalright 创建了任务
Jalright 关联仓库设置为xuthus/GoMD
展开全部操作日志

谢谢你的指正,如你所见,该程序大量使用切片,使得其存在诸多问题。我不清楚是否有时间,或者何时有时间来将这个项目继续完善。

xuthus 添加了
 
bug
标签

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
1203765 xuthus5 1578946074 1207709 jalright 1578946199
Go
1
https://gitee.com/xuthus5/GoMD.git
git@gitee.com:xuthus5/GoMD.git
xuthus5
GoMD
GoMD

搜索帮助