recaptcha v3 前端返回奇怪的,空的(无效?)结果与 )]}' [英] recaptcha v3 frontend returning strange, emptyish (invalid?) result with )]}'
本文介绍了recaptcha v3 前端返回奇怪的,空的(无效?)结果与 )]}'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试按照 reCAPTCHA v3 的说明进行操作,但似乎连基础知识都无法掌握.似乎 grecaptcha 执行返回了一个非常奇怪的、无法使用的结果.我正在本地主机上测试这个:7684
I am trying to follow the instructions for reCAPTCHA v3 but can't seem to get even the basics down. Seems like the grecaptcha execute is returning a very strange, unusable result. I am testing this on localhost:7684
<script src='https://www.google.com/recaptcha/api.js?render=MYSITEKEY'>
</script>
<script>
grecaptcha.ready(function() {
grecaptcha.execute('MYSITEKEY', {action:
'action_name'}).then(function(token) {
console.log(token);
alert(token);
});
});
</script>
<form action="http://localhost:7684/botcheck" method="post">
<input type="text" name="name" value="" placeholder="name" required />
<button type="submit">submit</button>
</form>
控制台显示令牌为空,我的 chrome 调试器显示此响应:
The console is showing the token is null, and my chrome debugger is showing this response:
)]}'
["rresp",null,null,null,null,null,10]
推荐答案
好吧,那太蠢了.问题是我必须将 action 参数更改为其他任何参数.看起来他们返回默认操作名称action_name"的结果
Ok, that was stupid. The problem was I had to change the action parameter to anything else. Looks like they return that result for the default action name "action_name"
这篇关于recaptcha v3 前端返回奇怪的,空的(无效?)结果与 )]}'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文