在 angular 上使用 Google ReCaptcha

Using Google ReCaptcha on angular

我在 angular 上使用 reCAPTCHA,有一两天它工作正常,但现在我收到一个错误,显示

We detected that your site is not verifying reCAPTCHA solutions. This is required for the proper use of reCAPTCHA on your site. Please see our developer site for more information.

我正在使用它提到

@Component({
    selector: 'my-app',
    template: `<re-captcha (resolved)="resolved($event)" siteKey="YOUR_SITE_KEY"></re-captcha>`,
}) export class MyApp {
    resolved(captchaResponse: string) {
        console.log(`Resolved captcha with response ${captchaResponse}:`);
    }
}

我是否遗漏了什么,我是否需要手动使用 ${captchaResponse} 执行某些操作,因为我正在使用 angular。

您需要post验证响应值,方法是从您的后端url调用

https://www.google.com/recaptcha/api/siteverify

看这里:https://developers.google.com/recaptcha/docs/verify