google recaptcha 验证

http://www.apl.com/ebusiness/schedules

在提交的时候会有一个参数:g-recaptcha-response 需要根据网站的siteKey 去谷歌验证获取

主要代码在这:

$(function () {
    $("#searchSchedules").click(function (event) {
        if (typeof grecaptcha !== 'undefined') {
            event.preventDefault();
            grecaptcha.ready(function () {
                grecaptcha.execute('6Ld4b8IUAAAAALgCoomRj6rNBbuX25b2y2ib_UZN', {action: 'RoutingFinder'}).then(function (token) {
                    $('#g-recaptcha-response').val(token);
                    $("#GenerateToken").submit();
                });
            });
        } else {
            $('#g-recaptcha-response').val('undefined');
            $("#GenerateToken").submit();
        }
    });
});

https://shimo.im/docs/yYTTvP3W3Pd6gxrc/read

这个可以用,收费的。自己研究的话参考一下文章:

https://blog.csdn.net/joyce_lcy/article/details/81980683

https://blog.csdn.net/baidu_38990811/article/details/86530350

猜你喜欢

转载自blog.csdn.net/xkx_07_10/article/details/105250236