Code Monkey home page Code Monkey logo

captcha's Introduction

图片验证码 - 前后端分离,图片验证码实现方案。

  • 客户端与服务端基于 Oauth2 进行通信,其中使用到 token 作为用户的数据令牌。

  • 服务端使用 Redis 作为集中式缓存,键值:{token, captcha_code}

  • 服务端提供两个接口

生成图片验证码
【GET】http://localhost:8080/v0.1/captcha?token=797fd0f3016b4184a0682348546b2ac0
验证图片验证码(一般情况下,这个接口会合并到登录接口中)
【GET】http://localhost:8080/v0.1/captcha/valid?token=797fd0f3016b4184a0682348546b2ac0&captchaCode=XUYD
  • 客户端可以使用 ajax 请求或者使用 img 标签。 这里,为了简单起见,就使用 img 标签。地址:{project}/src/main/resources/page

  • 接口测试,可以使用 postman 这里,附带 postman 脚本。地址:{project}/src/main/resources/postman

captcha's People

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.