完善站点运营设置:分路由管理、登录可见评论、邮件模板内联与关闭注册 SSR。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,6 +50,20 @@ func (h *Handlers) PostComments(c *gin.Context) {
|
||||
})
|
||||
return
|
||||
}
|
||||
if requireLogin, err := h.Setting.CommentsRequireLogin(); err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "评论暂时不可用"})
|
||||
return
|
||||
} else if requireLogin && viewerID == 0 {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"comments": []any{},
|
||||
"total": 0,
|
||||
"total_comments": 0,
|
||||
"page": page,
|
||||
"size": size,
|
||||
"require_login": true,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
boardID, _ := h.Post.GetBoardID(uint(id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user