mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-18 17:48:00 +08:00
1.迁移表时添加字段注释
2.修复游客状态评论接口报空指针的问题
This commit is contained in:
@@ -22,8 +22,8 @@ func (c *CommentController) Lists() {
|
||||
page := pagination.PageUtil(int(count), pageIndex, conf.PageSize, comments)
|
||||
|
||||
var data struct {
|
||||
DocId int `json:"doc_id"`
|
||||
Page pagination.Page `json:"page"`
|
||||
DocId int `json:"doc_id"`
|
||||
Page pagination.Page `json:"page"`
|
||||
}
|
||||
data.DocId = docid
|
||||
data.Page = page
|
||||
@@ -43,6 +43,9 @@ func (c *CommentController) Create() {
|
||||
|
||||
m := models.NewComment()
|
||||
m.DocumentId = id
|
||||
if c.Member == nil {
|
||||
c.JsonResult(1, "请先登录,再评论")
|
||||
}
|
||||
if len(c.Member.RealName) != 0 {
|
||||
m.Author = c.Member.RealName
|
||||
} else {
|
||||
@@ -56,7 +59,7 @@ func (c *CommentController) Create() {
|
||||
m.Insert()
|
||||
|
||||
var data struct {
|
||||
DocId int `json:"doc_id"`
|
||||
DocId int `json:"doc_id"`
|
||||
}
|
||||
data.DocId = id
|
||||
|
||||
|
Reference in New Issue
Block a user