From f37901f85f616397405bc087a5ec1803d1be1f7f Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 19 Oct 2022 22:41:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/detail.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actions/detail.go b/actions/detail.go index 7ec67e5..c4175c7 100644 --- a/actions/detail.go +++ b/actions/detail.go @@ -85,7 +85,13 @@ func Detail(c *gin.Context) { h["post"] = post h["showComment"] = showComment h["prev"] = prev - h["comments"] = hh.formatComment(commentss, 1, 5) + depth := models.Options["thread_comments_depth"] + d, err := strconv.Atoi(depth) + if err != nil { + logs.ErrPrintln(err, "get comment depth") + d = 5 + } + h["comments"] = hh.formatComment(commentss, 1, d) h["next"] = next }