腾讯防水墙(滑动验证码)的简单使用 https://007.qq.com

本文转载于:猿2048网站https://www.mk2048.com/blog/blog.php?id=h0b1j&title=%E8%85%BE%E8%AE%AF%E9%98%B2%E6%B0%B4%E5%A2%99%28%E6%BB%91%E5%8A%A8%E9%AA%8C%E8%AF%81%E7%A0%81%29%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8+https%3A%2F%2F007.qq.com

在线体验:https://007.qq.com/online.html

快速开始:https://007.qq.com/quick-start.html

简单使用:

1. 引入 JS

<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>

2. 写一个JS方法

// 腾讯防水墙 https://007.qq.com
function submitFormWithCaptcha() {
    // 直接生成一个验证码对象
    var captcha = new TencentCaptcha('AppID', function (res) {
        console.log(res)
        // res(未通过验证)= {ret: 1, ticket: null}
        // res(验证成功) = {ret: 0, ticket: "String", randstr: "String"}
        if (res.ret === 0) {
                //票据
                //alert(res.ticket)  
                //随机串
                //alert(res.randstr)  
                submitForm();
        } 
    });
    // 显示验证码
    captcha.show(); 
}

3. 页面的某个按钮调用这个方法。

4. 后台方法(略)

 

本文转载于:https://www.mk2048.com/blog/blog.php?id=h0b1j&title=%E8%85%BE%E8%AE%AF%E9%98%B2%E6%B0%B4%E5%A2%99%28%E6%BB%91%E5%8A%A8%E9%AA%8C%E8%AF%81%E7%A0%81%29%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8+https%3A%2F%2F007.qq.com

转载于:https://my.oschina.net/u/4181724/blog/3085406

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值