12345678910111213141516 |
- const express = require('express')
- const router = express.Router()
- const imageCaptch = require('svg-captcha')
- router.get('/', async (req, res) => {
- const svgimg = imageCaptch.create({
- size: 4,
- ignoreChars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
- noise: 2,
- color: true
- })
- req.session.imgtext = svgimg.text
- res.send(svgimg.data)
- })
- module.exports = router
|