# captcha
**Repository Path**: gester/captcha
## Basic Information
- **Project Name**: captcha
- **Description**: 一个好用开源验证码项目,项目包括字符验证码、运算验证码及滑动验证码功能的集成
- **Primary Language**: Java
- **License**: MIT
- **Default Branch**: develop
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 185
- **Forks**: 54
- **Created**: 2019-08-06
- **Last Updated**: 2025-03-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: 滑动验证, 字符验证, 运算验证
## README
#### 简介
项目集成字符验证码、运算验证码、滑动验证码
具有代码简洁、注释完备、配置灵活、易于上手的特点,适合所有开发者集成
#### 功能
- 字符验证码
- 运算验证码
- 滑动验证码
#### 快速访问
1. 快速访问: http://localhost:8080/captcha/index
2. 字符验证码: http://localhost:8080/captcha/index?type=char
3. 运算验证码: http://localhost:8080/captcha/index?type=operation
4. 滑动验证码: http://localhost:8080/captcha/index?type=slide
#### 使用说明
> 主要提供后端直接集成使用,前端只做简单演示,几类验证码按需定制使用
> 滑动验证码主要逻辑在ImageVerificationUtil、CaptchaServiceImpl两个类中
> 滑动验证码可以在yml中配置模板和样式图片,如果不配置默认使用/static/templates的模板和/static/targets样式图片
字符验证码、运算验证码、滑动验证码有工具类,开箱即用;同时,字符验证码、运算验证码集成了kaptcha验证码功能
- 字符验证码:
默认使用kaptcha验证码。开箱即用,不需要任何配置就可以访问
- 运算验证码:
默认使用kaptcha验证码。开箱即用,已经将运算器类配置好。如果需要更改和自定义运算方法请移步:
config.selfimpr.captcha -> config -> CaptchaConfig -> getKaptchaBeanMath()
- 滑动验证码:
需要将自己的验证码图片配置到application.yml文件路径中。相关的验证码图片和模板在以下位置:
项目中resources -> static -> targets和templates目录
#### 许可证
[](https://img.shields.io/badge/License-MIT-orange)
#### 预览图
预览图1
预览图2
预览图3
预览图4
预览图5