Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aqiu202/captcha-spring-boot-starter
Spring Boot集成验证码的一个既简单又强大的starter,且配置灵活!
https://github.com/aqiu202/captcha-spring-boot-starter
captcha captcha-spring-boot-starter java jcaptcha jcaptcha-spring-boot-starter kaptcha kaptcha-spring-boot-starter spring springboot
Last synced: about 2 months ago
JSON representation
Spring Boot集成验证码的一个既简单又强大的starter,且配置灵活!
- Host: GitHub
- URL: https://github.com/aqiu202/captcha-spring-boot-starter
- Owner: aqiu202
- License: apache-2.0
- Created: 2020-08-13T08:36:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T01:41:28.000Z (over 4 years ago)
- Last Synced: 2023-03-04T23:19:20.928Z (almost 2 years ago)
- Topics: captcha, captcha-spring-boot-starter, java, jcaptcha, jcaptcha-spring-boot-starter, kaptcha, kaptcha-spring-boot-starter, spring, springboot
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# captcha-spring-boot-starter - A captcha generation engine with spring boot.
## Spring Boot集成验证码的一个既简单又强大的starter,且配置灵活!
基于 [captcha](https://github.com/aqiu202/captcha) 和Spring Boot集成,已经发布到maven中央仓库
```xmlcom.github.aqiu202
captcha-spring-boot-starter
0.0.3```
项目开源地址:[https://github.com/aqiu202/captcha-spring-boot-starter](https://github.com/aqiu202/captcha-spring-boot-starter)## 配置
```yaml
captcha:
height: 80 #图片高度
width: 200 #图片宽度
has-border: true #设置图片为有边框
noise: #噪化方式先阴影,再添加曲线,再扭曲变形最后添加噪点
styles:
- SHADOW
- LINE
- SHEAR
- POINT
```## 使用试例
```java
@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);
}}
```