Skip to content

Commit 7a0b038

Browse files
authored
Merge pull request #189 from xuewenG/dev
提交评论接口检查评论是否开启
2 parents 5f00252 + c81059e commit 7a0b038

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/handler/comment.go

+5
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ func (c CommentHandler) AddComment(ctx echo.Context) error {
129129
}
130130
c.base.db.First(&sysConfig)
131131
_ = json.Unmarshal([]byte(sysConfig.Content), &sysConfigVO)
132+
133+
if !sysConfigVO.EnableComment {
134+
return FailRespWithMsg(ctx, Fail, "评论未开启")
135+
}
136+
132137
if err := checkGoogleRecaptcha(c.base.log, sysConfigVO, req.Token); err != nil {
133138
return FailRespWithMsg(ctx, Fail, err.Error())
134139
}

0 commit comments

Comments
 (0)