123456789101112131415161718192021222324 |
- const express = require('express');
- const router = express.Router();
- const svgCaptcha = require('svg-captcha');
- const c = svgCaptcha.create();
- router.get('/', (req, res, next) => {
- let captcha = svgCaptcha.create({
- size: 4,
- ignoreChars: '0o1ilI',
- noise: 2,
- color: true,
- fontSize: 50,
- width: 100,
- height: 36
- });
- req.session.captcha = captcha.text.toLowerCase();
- res.type('svg');
- res.status(200).send(captcha.data);
- });
- module.exports = router;
|