feat: @提及支持改名后链接跟随UID + 显示名自动更新
- comment_mentions新增original_username列,创建时记录原始@用户名
- Mentions map改为{original_username: {uid, name}}结构,name为当前显示名
- 用户改名后:旧@文本仍能匹配original_username,链接跟随uid不变,显示名自动更新
- 前端renderMentions适配新结构
This commit is contained in:
@ -222,8 +222,9 @@ func (s *CommentService) parseMentions(commentID uint, body string) {
|
||||
rows, _ := s.repo.SearchUsersByLevel(username, 2, 1)
|
||||
if len(rows) > 0 {
|
||||
_ = s.repo.CreateMention(&model.CommentMention{
|
||||
CommentID: commentID,
|
||||
UID: rows[0].UID,
|
||||
CommentID: commentID,
|
||||
UID: rows[0].UID,
|
||||
OriginalUsername: username,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user