mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-12-20 04:00:05 +08:00
Merge branch 'master' into new-beego-path
This commit is contained in:
@@ -144,17 +144,22 @@ func (c *DocumentController) Read() {
|
||||
doc.AttachList = attach
|
||||
}
|
||||
|
||||
doc.IncrViewCount(doc.DocumentId)
|
||||
c.Data["ViewCount"] = doc.ViewCount + 1
|
||||
|
||||
if c.IsAjax() {
|
||||
var data struct {
|
||||
DocTitle string `json:"doc_title"`
|
||||
Body string `json:"body"`
|
||||
Title string `json:"title"`
|
||||
Version int64 `json:"version"`
|
||||
ViewCount int `json:"view_count"`
|
||||
}
|
||||
data.DocTitle = doc.DocumentName
|
||||
data.Body = doc.Release
|
||||
data.Title = doc.DocumentName + " - Powered by MinDoc"
|
||||
data.Version = doc.Version
|
||||
data.ViewCount = doc.ViewCount + 1
|
||||
|
||||
c.JsonResult(0, "ok", data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user