typescript Verification code plug-in
npm install type-gverifynpm i type-gverify
yarn add type-gverify
import GVerify from 'type-gverify';
verifyCode = new GVerify({
id: 'v_container',
});
if ((verifyCode).validate(输入的验证码)) {
console.log('验证通过');
}
html:
``
| 参数 | 说明 |
|---|---|
| id | 容器Id |
| canvasId | canvas的ID |
| width | canvas宽度 |
| height | canvas高度 |
| type | blend:数字字母混合类型 | number:纯数字 | letter:纯字母 |
| size | 设置验证码长度 |