作者 yangfu

文章编辑修改

... ... @@ -102,7 +102,6 @@ func (m *Article) SetSummary(sectionList []*ArticleSection) {
//设置内容概要
// 截取内容 50个字
runeNumber := 0 //字数
stringIndex := 0 //字符串长度
content := ""
for i := range sectionList {
... ... @@ -112,12 +111,9 @@ func (m *Article) SetSummary(sectionList []*ArticleSection) {
break
}
}
for i := range content {
if runeNumber > 50 {
break
}
runeNumber += 1
stringIndex = i
stringIndex = len(content)
if len(content) > 50 {
stringIndex = 50
}
m.Summary = content[0:stringIndex]
}
... ...