小小API是一个稳定 快速 的 API 接口服务 点击加入QQ群
< !--导入JQ -->
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<script>
$.ajax({
url: '',
type: 'get',
beforeSend: function () {
//请求中执行的代码
},
complete: function () {
//请求完成执行的代码
},
error: function () {
//请求成功失败执行的代码
},
success: function (res) {
// 状态码 200 表示请求成功
if (res.code === 200) {
console.log(res)
} else {
console.log(res)
}
}
})
</script>
生成验证码
{
"code": 200,
"msg": "数据请求成功",
"data": {
"id": "vURyZ0UzjjMckUD8ZBCV",
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAABQCAMAAAD1LJoLAAABL1BMVEUAAAAvOyZFUTxwfGeIlH9CTjl/i3a+yrW4xK+hrZg2Qi2VoYyCjnk2Qi00QCsSHgl4hG8/SzYxPSglMRy4xK9WYk0YJA+Pm4Zrd2JpdWC6xrFealWSnok8SDMfKxZibll1gWxXY05rd2IjLxpwfGcLFwKDj3o5RTDDz7pNWUQmMh1gbFeSnomLl4KNmYQaJhGirpmHk35ealUyPilxfWgxPShVYUwQHAdgbFcUIAuFkXwqNiEaJhFKVkEsOCOJlYCSnolMWEODj3qirplFUTwfKxaDj3qhrZjE0Lufq5YZJRCCjnmKloFATDe/y7Zjb1ouOiVUYEtaZlE9STRSXkl9iXSHk367x7JCTjllcVwaJhEdKRSUoIsqNiERHQjDz7qUoIujr5oaJhEiLhkeKhVWbLiAAAAAAXRSTlMAQObYZgAACC9JREFUeJzsXFtP20wTnhEQqHq4aKVU5SKVSCUuuEBqe1MRlReBBKgVDVHyEkBAxf//EZ/i2N457XqdrJ306zuVSrLencOzz84ebAec3MJ/AvBFldzeOmTetuzN+siXLwYy5ae3b/9iZMzS+/xvW7h0jLJPLdmey1ZUrfv7+8Y9odLpaGQ+fWoSmUPxfWsrCpkrgctr9/FdCrekPHeeAd6LwkZxOVTIxDS7urpi31+/LpF5964ZZADev5fINCkSl0ihuOy3wJhM2sQlgezv76/ahTWVWF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vBUaAkkliXDodB4xmTIo9U7yYjIEYUBqQDntuxpQGrT/LAiv8tiHJ5Fi50CZjnp8VMmsix8fHiTVO53ojayfE5SaVom72fxbBAAC+ptE6nU4r8f4njSku+RPAIB74zISeO4Ymi2xF0+12i++DwQC+fk2FTPZ/EJd/mkFm/oc/8JkJPakOLS/ma2DoupKEjImRRnApZVnG/D/Lx9otfjTix7rJx49+ZHpm6Y8ffwky3ivlLS0hy+HyrcHabYmNy3Ly7VudWOvVDsiLJdq29DsrK2HMixeLIxP3OyvtyodkmkK4WL+BR2VFuATMfviQDhm/WL+BtwYSJGobuFQzRsn3ZvwQsn4DuEq+f28HmT9P2sXlfwEAAP//evV08z/333YAAAAASUVORK5CYII="
}
}
验证码错误
{
"code": -2,
"msg": "验证失败",
"data": ""
}
验证码正确
{
"code": 200,
"msg": "数据请求成功",
"data": "验证成功"
}