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

本文详细介绍腾讯防水墙(滑动验证码)的简单使用方法,包括如何引入JS库,创建并显示验证码,以及如何在后台处理验证结果。适用于希望增强网站安全性,防止自动化攻击的开发者。

本文转载于:猿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

要将 Maven 配置里的阿里云仓库地址(`https://maven.aliyun.com/nexus/content/groups/public/` 和 `https://maven.aliyun.com/repository/public`)替换成腾讯云的仓库地址,可通过以下两种方式实现: ### 在 POM.xml 中替换 若在 `POM.xml` 文件中配置了阿里云仓库地址,需将其替换为腾讯云的仓库地址。示例如下,把原有的阿里云仓库地址替换为腾讯云 Maven 公共代理仓库地址: ```xml <project> ... <repositories> <repository> <!-- 删除或注释掉阿里云仓库配置 --> <!-- <id>aliyun-public</id> <url>https://maven.aliyun.com/repository/public</url> --> <!-- 添加腾讯云仓库配置 --> <id>tencentcloud</id> <url>https://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <!-- 删除或注释掉阿里云仓库配置 --> <!-- <id>aliyun-public</id> <url>https://maven.aliyun.com/repository/public</url> --> <!-- 添加腾讯云仓库配置 --> <id>tencentcloud</id> <url>https://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url> </pluginRepository> </pluginRepositories> ... </project> ``` ### 在 settings.xml 中替换 若在 `settings.xml` 文件中配置了阿里云镜像,同样需要将其替换为腾讯云的镜像配置。示例如下: ```xml <mirrors> <!-- 删除或注释掉阿里云镜像配置 --> <!-- <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共仓库</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> --> <!-- 添加腾讯云镜像配置 --> <mirror> <id>tencentcloud</id> <mirrorOf>*</mirrorOf> <name>Tencent Cloud Maven Mirror</name> <url>https://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url> </mirror> </mirrors> ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值