Code Monkey home page Code Monkey logo

jigsaw-ts's Introduction

jigsaw滑动验证码

  1. 全局添加globals.d.ts文件
增加Window接口定义

declare global {
  interface Window { jigsaw: any; }
}
  1. 引入jigsaw.tsjigsaw.scss

  2. 初始化

    this.Jigsaw = jigsaw.init({
    
      el: document.getElementById('verificationContainer'),
      
      onSuccess: function () {
    
      },
      
      onFail: function () {
    
      },
      
      onRefresh: function () { 
    
      }
      
    })
    

Tips:

  1. 图片从 https://picsum.photos/ 随机获取,然后用canvas裁剪生成滑块。
  2. 未编译ES6语法,建议使用现代浏览器体验。
  3. 纯前端验证对安全性没意义,因此本项目仅供学习交流,不考虑实用性。

jigsaw-ts's People

Contributors

vitozyf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.