如何获取滑动验证码的图片(滑动图片验证码怎么实现自动化)
如何获取滑动验证码的图片,原文标题:一款快速生成滑动验证码图片的项目。《开源精选》是我们分享Github、Gitee等开源
如何获取滑动验证码的图片,原文标题:一款快速生成滑动验证码图片的项目。
《开源精选》是我们分享Github、Gitee等开源社区中优质项目的栏目,包括技术、学习、实用与各种有趣的内容。本期推荐的 captcha用于生成滑动验证码拼图图片和背景图片。

项目安装
npm i @itriton/captcha
使用方法
const captcha = require('@itriton/captcha')// 默认(promise)captcha.create().then(res=>{ console.log(res)})// 自定义参数(promise)captcha.create(options).then(res=>{ console.log(res)})// 默认(async/await)async function captcha(){ const result = await captcha.create()}// 自定义参数(async/await)async function captcha(){ const result = await captcha.create(options)}
参数设置
属性名 | 类型 | 默认值 | 说明 |
size | Number | 30 | 默认拼图大小 |
width | Number | 270 | 图片宽度(px) |
height | Number | 144 | 图片高度(px) |
url | String | – | 图片路径(支持在线地址) |
结合 @itriton/uniapp 组件库的 行为验证(captcha)组件
快速上手
- main.js引入iTriton库
// main.jsimport itriton from '@itriton/uniapp';Vue.use(itriton);
- App.vue引入基础样式(注意style标签需声明scss属性支持)
/* App.vue */<style lang="scss">@import "@itriton/uniapp/index.scss";</style>
- uni.scss引入全局scss变量文件
/* uni.scss */@import "@itriton/uniapp/theme.scss";
- pages.json配置easycom规则(按需引入)
// pages.json{ "easycom": { // npm安装的方式不需要前面的"@/",下载安装的方式需要"@/" // npm安装方式 "^t-(.*)": "@itriton/uniapp/components/t-$1/t-$1.vue" // 下载安装方式 // "^t-(.*)": "@/@itriton/uniapp/components/t-$1/t-$1.vue" }, // 此为本身已有的内容 "pages": [ // ...... ]}
使用方法
配置easycom规则后,自动按需引入,无需import组件,直接引用即可。
<template> <t-date-picker></t-date-picker></template>
消息弹幕组件示例
基本使用
<t-barrage :list="list" :row="1"> <template v-slot:scope="{item}"> <view class="barrage">{{item.title}}</view> </template></t-barrage>
更多内容:https://gitee.com/ibaleine-open-source/itriton-captcha
本文《如何获取滑动验证码的图片(滑动图片验证码怎么实现自动化)》由网赚联盟( wangzhuan.org.cn )整理或原创,感谢您的阅读。随机文章
站长导航搜素引擎算法
SEO小小课堂网
SEO教程
站长导航
友情链接交换
搜素引擎算法
关键词排名优化
百度搜索“网赚联盟”即可找到本站,微信搜索“小小课堂网”关注小小课堂网公众号。网赚联盟( wangzhuan.org.cn )欢迎用户投稿,发布者:GitHub精选,文章版权归作者所有,投稿文章不代表网赚联盟立场,中二少年发布为网赚联盟原创文章,转载请注明出处:https://wangzhuan.org.cn/745330.html

微信扫一扫
支付宝扫一扫