完善站点运营设置:分路由管理、登录可见评论、邮件模板内联与关闭注册 SSR。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 00:17:00 +08:00
parent acde7ee288
commit 6f054a903c
98 changed files with 8239 additions and 2073 deletions

View File

@@ -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))