1.9.6 • Published 2 years ago
wanglipan-svg-capcha v1.9.6
###🍓 验证码模块下载
npm i wanglipan-svg-capcha -S
###😻 验证码模块使用
const captcha = require('wanglipan-svg-capcha') let abcd = captcha.getCode() console.log(abcd) // {text:'w28CJi', data: '**'}
###⏰结合http模块
const http=require('http')
const captcha = require('wanglipan-svg-capcha')
http.createServer((req,res)=>{
res.setHeader('content-type','text/html;charset=utf-8')
let abcd = captcha.getCode()
res.end(abcd.data)
}).listen(3000,()=>{
console.log('启动成功, 访问 http://localhost:3000'); })