Skip to content

Commit 07f8d08

Browse files
authored
Merge pull request #1054 from xiaomakuaiz/feat-enable-captcha
feat: enable captcha by default
2 parents 9d87235 + 035e327 commit 07f8d08

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

backend/usecase/app.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,15 @@ func (u *AppUsecase) GetAppDetailByKBIDAndAppType(ctx context.Context, kbID stri
401401
appDetailResp.Settings.AIFeedbackSettings.AIFeedbackType = []string{"内容不准确", "没有帮助", "其他"}
402402
}
403403

404+
// default enable captcha
405+
if app.Settings.CaptchaSettings.ChatStatus == "" {
406+
app.Settings.CaptchaSettings.ChatStatus = consts.CaptchaStatusEnable
407+
}
408+
if app.Settings.CaptchaSettings.CommentStatus == "" {
409+
app.Settings.CaptchaSettings.CommentStatus = consts.CaptchaStatusEnable
410+
}
411+
412+
// get recommend nodes
404413
if len(app.Settings.RecommendNodeIDs) > 0 {
405414
nodes, err := u.nodeUsecase.GetRecommendNodeList(ctx, &domain.GetRecommendNodeListReq{
406415
KBID: kbID,
@@ -461,6 +470,13 @@ func (u *AppUsecase) GetWebAppInfo(ctx context.Context, kbID string) (*domain.Ap
461470
if app.Settings.AIFeedbackSettings.AIFeedbackType == nil {
462471
appInfo.Settings.AIFeedbackSettings.AIFeedbackType = []string{"内容不准确", "没有帮助", "其他"}
463472
}
473+
// default enable captcha
474+
if app.Settings.CaptchaSettings.ChatStatus == "" {
475+
app.Settings.CaptchaSettings.ChatStatus = consts.CaptchaStatusEnable
476+
}
477+
if app.Settings.CaptchaSettings.CommentStatus == "" {
478+
app.Settings.CaptchaSettings.CommentStatus = consts.CaptchaStatusEnable
479+
}
464480

465481
return appInfo, nil
466482
}

0 commit comments

Comments
 (0)