简体   繁体   English

Google Recaptcha V2验证过期后

[英]Google Recaptcha V2 Validation after expired

I used the google recaptcha v2 in long form. 我使用了Google Recaptcha v2的长格式。 Before click the captcha validation handled by handleCorrectCaptcha method. 在单击由handleCorrectCaptcha方法处理的验证码验证之前。 If click the captcha checkbox then the captcha expired before the form submitting. 如果单击验证码复选框,则验证码在提交表单之前已过期。 Then when i click the submit button form becomes submitted without captcha. 然后,当我单击提交按钮时,表单就变成没有验证码的提交了。 I don't know how to validate after captcha expired. 验证码过期后,我不知道如何验证。 Even i go through the https://support.google.com/recaptcha/?hl=en. 甚至我都经过https://support.google.com/recaptcha/?hl=zh-CN。 I don't find the solution. 我找不到解决方案。 Thanks in advance 提前致谢

My Html code is 我的HTML代码是

<re-captcha (captchaResponse)="handleCorrectCaptcha($event)"  site_key="*****************************"></re-captcha>

My Angular2 Code is 我的Angular2代码是

handleCorrectCaptcha(captchaResponse: string) {
  this.captchaResponse=captchaResponse;
  this.appRef.tick();
}

重新输入错误

HTML code is HTML代码是

<re-captcha (captchaResponse)="handleCorrectCaptcha($event)"  
site_key="*****************************" (captchaExpired)="handleExpired()">
</re-captcha>  

Angular2 Code is Angular2代码为

handleCorrectCaptcha(captchaResponse: string) {
  this.captchaResponse=captchaResponse;
  this.appRef.tick();
}

handleExpired(){
  this.captchaResponse=null
}

I ask sorry for posting the simple question 我很抱歉发布这个简单的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM