Google Enterprise Recaptcha评分基础指标未记录请求问题咨询
reCAPTCHA企业版指标无数据解决方案
- 确认你使用的site key属于reCAPTCHA企业版,而非普通reCAPTCHA v3密钥。两类密钥的后台数据相互独立,混用情况下后端校验可正常通过,但请求数据不会同步至企业版指标面板。
- 检查前端引入的reCAPTCHA SDK地址,企业版必须使用
https://www.google.com/recaptcha/enterprise.js,如果引入的是普通版本SDK,调用数据不会上报到企业版指标系统。 - 确认Google Cloud后台查看指标的项目,和创建对应site key的项目完全一致,不同项目的reCAPTCHA数据不互通。
- 指标数据存在最长15分钟的同步延迟,你可以等待半小时后再刷新后台确认数据是否上报。
- 检查Django后端的token校验逻辑,确保调用的是reCAPTCHA企业版的
assessments校验接口,若使用普通v3的校验接口,也会导致前端请求不计入企业版指标。
你提供的前端代码逻辑本身没有问题,可按需调整为async/await写法减少嵌套:
methods: { async login() { try { await grecaptcha.enterprise.ready() const token = await grecaptcha.enterprise.execute(process.env.SITE_KEY, { action: "login" }) this.auth.token = token await this.$auth.loginWith("local", { data: this.auth }) } catch (e) { const errorText = e?.response?.data?.error || "Captcha Error" this.$notify({ group: "login", type: "error", title: "ERROR:", text: errorText }) } } }
内容的提问来源于stack exchange,提问作者Dean Christian Armada
相关产品推荐
相关产品推荐

