首页 > 解决方案 > Google Enterprise Recaptcha 对未记录请求的基本指标进行评分

问题描述

我遵循了前端集成 javascript示例,它显然可以正常工作。

我能够在我的 django 后端评估我从grecaptcha.enterprise.execute一个 action收到的令牌login

但是,当我查看该站点密钥的指标时,不会捕获请求或任何分析。

编辑: 下面是我的 NuxtJS 实现

methods: {
  login() {
    const _this = this;
    try {
      grecaptcha.enterprise.ready(function() {
        grecaptcha.enterprise
          .execute(process.env.SITE_KEY, {
            action: "login"
          })
          .then(function(token) {
            _this.auth.token = token;
            try {
              _this.$auth.loginWith("local", {
                data: _this.auth
              });
            } catch (e) {
              _this.$notify({
                group: "login",
                type: "error",
                title: "ERROR:",
                text: e.response.data.error
              });
            }
          });
      });
    } catch (e) {
      this.$notify({
        group: "login",
        type: "error",
        title: "ERROR:",
        text: "Captcha Error"
      });
    }
  }
}

标签: recaptcha-enterprise

解决方案


推荐阅读