当前位置:网站首页>Broadcast platform, the use of the node generated captcha image, and validate
Broadcast platform, the use of the node generated captcha image, and validate
2022-08-03 00:37:00 【Cloud Leopard Network Technology】
搭建直播平台,使用node生成验证码图片,并进行验证
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
<title>验证码测试</title>
</head>
<body>
<div id="box"></div>
<button id="btn">刷新</button>
<input type="text" id="ipt" />
<span id="span"></span>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script>
const box = document.querySelector('#box')
const btn = document.querySelector('#btn')
const ipt = document.querySelector('#ipt')
const span = document.querySelector('#span')
// 存放正确的验证码文本
let text = ''
// 获取验证码图片和文本
function getInfo() {
$.get('http://127.0.0.1/getInfo', (res) => {
// 正确验证码的信息
text = res.text
// res.data是一个验证码图片 svg标签
box.innerHTML = res.data
console.log(text)
})
}
getInfo()
btn.addEventListener('click', getInfo)
ipt.addEventListener('blur', function (e) {
if (this.value.toLowerCase() === text.toLowerCase()) {
span.innerHTML = '验证通过'
span.style.color = 'green'
} else {
span.innerHTML = '验证不通过'
span.style.color = 'red'
}
})
</script>
</body>
</html>
That is broadcast platform,使用node生成验证码图片,并进行验证, 更多内容欢迎关注之后的文章
边栏推荐
- matplotlib绘图的核心原理讲解(超详细)
- The interviewer asked me: delete library, in addition to run do?
- IP协议(网际协议)
- Intensive reading of the Swin Transformer paper and analysis of its model structure
- golang 刷leetcode:统计打字方案数
- golang 刷leetcode:从栈中取出 K 个硬币的最大面值和
- Byte's internal technical map is amazing and practical
- 同样月薪6K,为什么同事跳槽月薪翻倍,而你只涨了1000?
- js函数防抖和函数节流及其他使用场景
- golang刷letcode:公司命名
猜你喜欢
随机推荐
【学习笔记】博弈论
[c] Detailed explanation of operators (1)
Interviewer: can you talk about optimistic locking and pessimistic locks
SRv6网络演进面临的挑战
[C题目]力扣1. 两数之和
JumpServer开源堡垒机完成龙芯架构兼容性认证
Do you understand the factory pattern?
总结嵌入式C语言难点(2部分)
牛客每日刷题之链表
UDP (User Datagram Protocol)
从零开始配置 vim(5)——本地设置与全局设置
万物智联时代,悄然走入生活
手把手教你干掉if else
不堪哥哥殴打谩骂,妹妹申请人身安全保护令获支持
圆锥折射作为偏振计量工具的模拟
2018HBCPC个人题解
2022-08-02 第六小组 瞒春 学习笔记
Jmeter二次开发实现rsa加密
FRED应用:激光二极管光源耦合到光纤的仿真
【STM32学习2】存储器相关概念与操作







![[C题目]力扣138. 复制带随机指针的链表](/img/f6/75f6821343944ced9f1cdec8dffe5c.png)

