reCaptcha在表单提交时将响应添加到我的URL中

问题描述

我正在使用vue-recaptcha,并注意到当我submit我的form时,response污染了我的URL,如下例所示:

My_URL /?g-recaptcha-response = 03AGdBq24KB70qT57 ............

有办法阻止这种情况吗?

index.html文件

<head>
  <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
</head>

部分组件代码

<template>
  <div class="form-group">
      <vueRecaptcha sitekey="[MY-KEY-HERE]" :loadRecaptchaScript="true" @verify="reCaptcha" />
  </div>
  <div class="form-row d-flex justify-content-end">
      <button type="submit" class="btn btn-success mr-2" @click="submitClicked">Submit</button>
  </div>
</template>

<script>
  import vueRecaptcha from 'vue-recaptcha';

  components: {
    vueRecaptcha
  },data() {
    return {
      reCaptchaResponse: ''
    }
  }    
  
  methods: {
    reCaptcha(response) {
      this.reCaptchaResponse = response;
    },submitClicked() {
        this.formSubmittedLoader = true;
        this.reCaptchaResponse = '';

        setTimeout(() => {
            this.formSubmittedLoader = false;
            this.pageLoad();
            grecaptcha.reset();
            this.$eventHub.$emit('show-success-modal',{ data: 'N/A',messageFor: 'contactUsSuccess' });
        },1500);
    }
  </script>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)