不提供稳定服务,请勿使用!随时可能关闭服务,如需稳定使用,请联系作者!
Email:physton@163.com
<div class="pcaptcha"></div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://pcaptcha.physton.com/js/pcaptcha.min.js"></script>
<script type="text/javascript">
$(".pcaptcha").pcaptcha({
site_key : 'xxxxxxx', //授权的site key
theme : 'theme-default', //主题. theme-default, theme-dark, theme-light, theme-transparent
width : '100%', //宽度
input_name: 'captcha', //输入框名称,验证成功后将成功key置入隐藏的input输入框中。用于提交到后台
//验证失败回调函数
onfail : function(pcaptcha, data) {
//console.log(pcaptcha.id);
//console.log(data);
},
//验证通过回调函数
onsuccess : function(pcaptcha, data) {
//console.log(pcaptcha.id);
//console.log(data);
},
//初始化完成回调函数
onload : function(pcaptcha) {
//console.log(pcaptcha.id);
}
});
//$(".pcaptcha").pcaptcha("reset"); //重置
</script>
后台将input的数据POST到接口:https://pcaptcha.physton.com/verify/ 校验用户是否成功通过人机验证
POST参数:【token】: 输入框的数据;【api_key】: 授权的api key
© CopyRight 2015, Physton, Inc.All Rights Reserved.