增加“极验-行为验”验证码集成支持

This commit is contained in:
刘祥超
2023-11-29 16:57:58 +08:00
parent 7deaa678bc
commit 0d21fc27ab
7 changed files with 117 additions and 20 deletions

View File

@@ -141,6 +141,23 @@ func (this *UpdateAction) RunPost(params struct {
this.Fail("验证码动作参数校验失败:" + err.Error())
}
// 检查极验配置
if captchaOptions.CaptchaType == firewallconfigs.CaptchaTypeGeeTest || captchaOptions.GeeTestConfig.IsOn {
if captchaOptions.CaptchaType == firewallconfigs.CaptchaTypeGeeTest && !captchaOptions.GeeTestConfig.IsOn {
this.Fail("人机识别动作配置的默认验证方式为极验-行为验,所以需要选择允许用户使用极验")
return
}
if len(captchaOptions.GeeTestConfig.CaptchaId) == 0 {
this.FailField("geetestCaptchaId", "请输入极验-验证ID")
return
}
if len(captchaOptions.GeeTestConfig.CaptchaKey) == 0 {
this.FailField("geetestCaptchaKey", "请输入极验-验证Key")
return
}
}
// 最大内容尺寸
if params.MaxRequestBodySize < 0 {
params.MaxRequestBodySize = 0