我正在尝试使用新的验证码,但正如标题所说,如果我提交了两次表单,它会失败。
我读到我应该在提交后重置我的令牌,我尝试这样做
grecaptcha.ready(function() {
// do request for recaptcha token
// response is promise with passed token
grecaptcha.execute('6LeH6Y4UAAAAABwpPXv0NjMAQp56WypP5hFz45ZM', {
action: 'contactus'
})
.then(function(token) {
// add token value to form
document.getElementById('g-recaptcha-response').value = token;
});
});
我究竟做错了什么?