mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-23 20:53:46 +08:00
perf:优化部分代码
This commit is contained in:
@@ -298,4 +298,23 @@ func (item *Document) ReleaseContent() error {
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//追加一些文档信息.
|
||||
func (doc *Document) AppendInfo() *Document {
|
||||
|
||||
docCreator, err := NewMember().Find(doc.MemberId,"real_name","account")
|
||||
|
||||
if strings.TrimSpace(doc.Release) != "" {
|
||||
doc.Release += "<div class=\"wiki-bottom\">文档更新时间: " + doc.ModifyTime.Local().Format("2006-01-02 15:04") + " 作者:";
|
||||
if err == nil && docCreator != nil {
|
||||
if docCreator.RealName != "" {
|
||||
doc.Release += docCreator.RealName
|
||||
} else {
|
||||
doc.Release += docCreator.Account
|
||||
}
|
||||
}
|
||||
doc.Release += "</div>"
|
||||
}
|
||||
return doc
|
||||
}
|
Reference in New Issue
Block a user