Skip to content

Commit

Permalink
fix(rss): Author标签中添加Email字段
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinvic committed Feb 13, 2025
1 parent ccd1686 commit c78a9bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/handler/rss.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (r RssHandler) generateRss(host string) (string, error) {

// 查询动态
tx := r.base.db.Preload("User", func(x *gorm.DB) *gorm.DB {
return x.Select("username", "nickname", "id")
return x.Select("username", "nickname", "id", "email")
}).Where("showType = 1")
tx.Order("createdAt desc").Limit(15).Find(&memos)

Expand Down Expand Up @@ -99,7 +99,7 @@ func generateFeed(memos []db.Memo, sysConfigVO *vo.FullSysConfigVO, user *db.Use
Title: sysConfigVO.Title,
Link: &feeds.Link{Href: fmt.Sprintf("%s/rss", host)},
Description: user.Slogan,
Author: &feeds.Author{Name: user.Nickname},
Author: &feeds.Author{Name: user.Nickname, Email: user.Email},
Created: now,
}

Expand All @@ -111,7 +111,7 @@ func generateFeed(memos []db.Memo, sysConfigVO *vo.FullSysConfigVO, user *db.Use
Title: fmt.Sprintf("Memo #%d", memo.Id),
Link: &feeds.Link{Href: memoLink},
Description: parseMarkdownToHtml(getContentWithExt(memo, host)),
Author: &feeds.Author{Name: memo.User.Nickname},
Author: &feeds.Author{Name: memo.User.Nickname, Email: memo.User.Email},
Created: *memo.CreatedAt,
Updated: *memo.UpdatedAt,
})
Expand Down

0 comments on commit c78a9bf

Please sign in to comment.