Git Product home page Git Product logo

captcha-spring-boot-starter's Introduction

captcha-spring-boot-starter - A captcha generation engine with spring boot.

Spring Boot集成验证码的一个既简单又强大的starter,且配置灵活!

基于 captcha 和Spring Boot集成,已经发布到maven**仓库

<dependency>
  <groupId>com.github.aqiu202</groupId>
  <artifactId>captcha-spring-boot-starter</artifactId>
  <version>0.0.3</version>
</dependency>

项目开源地址:https://github.com/aqiu202/captcha-spring-boot-starter

配置

captcha:
  height: 80 #图片高度
  width: 200 #图片宽度
  has-border: true #设置图片为有边框
  noise: #噪化方式先阴影,再添加曲线,再扭曲变形最后添加噪点
    styles:
      - SHADOW
      - LINE
      - SHEAR
      - POINT

使用试例

@Validated
@RestController
public class VerifyCodeController {

    @Autowired
    private CaptchaProducer producer;

    /**
     * 获取验证码
     * @author aqiu
     **/
    @GetMapping("/verify-code/code")
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String text = this.producer.createText();
        req.getSession().setAttribute("CODE", text);
        this.producer.writeToResponse(text, resp);
    }

}

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.