优化评论区展示:弱化用户名样式、调整回复布局与编辑时限。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -282,8 +282,8 @@ func (s *CommentService) Update(userID, commentID uint, isAdmin bool, content st
|
||||
return "", ErrPermissionDenied
|
||||
}
|
||||
if !isAdmin {
|
||||
window := s.settings.CommentEditWindowHours()
|
||||
if window > 0 && time.Since(comment.CreatedAt) > time.Duration(window)*time.Hour {
|
||||
window := s.settings.CommentEditWindowMinutes()
|
||||
if window > 0 && time.Since(comment.CreatedAt) > time.Duration(window)*time.Minute {
|
||||
return "", errors.New("已超过可编辑时限")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user