# AJ-Captcha **Repository Path**: php_java/captcha ## Basic Information - **Project Name**: AJ-Captcha - **Description**: 行为验证码(滑动拼图、点选文字),前后端(java)交互,包含vue/h5/Android/IOS/flutter/uni-app/react/php/微信小程序的源码和实现 - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: https://captcha.anji-plus.com/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1856 - **Created**: 2021-09-08 - **Last Updated**: 2021-09-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)[![Total Lines](https://tokei.rs/b1/github/anji-plus/captcha?category=lines)](https://github.com/anji-plus/captcha) [![EN doc](https://img.shields.io/badge/document-English-blue.svg)](README.md)[![CN doc](https://img.shields.io/badge/文档-中文版-blue.svg)](README_CN.md) ## 简介     AJ-Captcha由 [安吉加加](http://www.anji-plus.com) 开源的一个行为验证码,包含滑动拼图、文字点选两种方式,UI支持弹出和嵌入两种方式。后端提供Java实现,前端提供了php、angular、html、vue、uni-app、flutter、android、ios等代码示例。 # 1 在线体验 ####   1.1 电脑在线体验:[https://captcha.anji-plus.com/](https://captcha.anji-plus.com/ "链接") ####   1.2 在线文档:[https://captcha.anji-plus.com/#/doc](https://captcha.anji-plus.com/#/doc "doc")
####   1.3 微信小程序和H5在线体验(基于uni-app实现)    如果图片未能正常展示,可查看码云,和github同步 [码云]( https://gitee.com/anji-plus/captcha "码云")
![微信小程序](https://captcha.anji-plus.com/static/8cm.jpg "微信小程序")  ![h5](https://images.gitee.com/uploads/images/2020/0429/174246_c33e3fa3_1728982.png "h5.png")
    微信小程序Demo            uni-app H5 demo # 2 功能概述 ####   2.1 组件介绍    行为验证码采用嵌入式集成方式,接入方便,安全,高效。抛弃了传统字符型验证码展示-填写字符-比对答案的流程,采用验证码展示-采集用户行为-分析用户行为流程,用户只需要产生指定的行为轨迹,不需要键盘手动输入,极大优化了传统验证码用户体验不佳的问题;同时,快速、准确的返回人机判定结果。目前对外提供两种类型的验证码,其中包含滑动拼图、文字点选。如图1-1、1-2所示。若希望不影响原UI布局,可采用弹出式交互。
   后端基于Java实现,提供纯Java.jar和SpringBoot Starter。前端提供了Android、iOS、Futter、Uni-App、ReactNative、Vue、Angular、Html、Php等多端示例。
| 滑动拼图 | 文字点选 | | --- | --- | |![滑动拼图](https://captcha.anji-plus.com/static/blockPuzzle.png "滑动拼图") |![点选文字](https://captcha.anji-plus.com/static/clickWord.png "点选文字")| | 图1-1 | 图1-2 |
####   2.2 概念术语描述 | 术语 | 描述 | | ------------ | ------------ | | 验证码类型 | 1)滑动拼图 blockPuzzle 2)文字点选 clickWord| | 验证 | 用户拖动/点击一次验证码拼图即视为一次“验证”,不论拼图/点击是否正确 | | 二次校验 | 验证数据随表单提交到后台后,后台需要调用captchaService.verification做二次校验。目的是核实验证数据的有效性。 | # 3 交互流程 ① 用户访问应用页面,请求显示行为验证码
② 用户按照提示要求完成验证码拼图/点击
③ 用户提交表单,前端将第二步的输出一同提交到后台
④ 验证数据随表单提交到后台后,后台需要调用captchaService.verification做二次校验。
⑤ 第4步返回校验通过/失败到产品应用后端,再返回到前端。如下图所示。 ![时序图](https://captcha.anji-plus.com/static/shixu.png "时序图") # 4 目录结构 ├─core
│ ├─captcha    java核心源码
│ └─captcha-spring-boot-starter    springboot快速启动
├─images       效果图
├─service
│ ├─php    后端为php项目示例
│ ├─springboot    后端为springboot项目示例
│ └─springmvc    后端为springmvc非springboot项目示例
└─view       多语言客户端示例
 ├─android    原生android实现示例
 ├─angular    angular实现示例
 ├─flutter    flutter实现示例
 ├─html    原生html实现示例
 ├─ios    原生ios实现示例
 ├─php    php实现示例
 ├─react    react实现示例
 ├─uni-app    uni-app实现示例
 ├─wx-applet    微信小程序实现示例
 └─vue    vue实现示例
  # 5 接入文档 ####   5.1 本地启动   第一步,启动后端,导入Eclipse或者Intellij,启动service/springboot的StartApplication。[社区底图库](https://gitee.com/anji-plus/AJ-Captcha-Images)
  第二步,启动前端,使用visual code打开文件夹view/vue,npm install后npm run dev,浏览器登录
```js npm install npm run dev DONE Compiled successfully in 29587ms 12:06:38 I Your application is running here: http://localhost:8081 ```  详细的前后端接入文档,后端示例代码service目录下,前端示例代码view目录下。 # 6 技术支持,如有问题,请提交Issue 微信一二群已满,现开放三群。微信群码会不定期更新。
微信群地址:https://captcha.anji-plus.com/static/weixin.png | 微信 | qq | | --- | --- | ||| #### 开源不易,劳烦各位star ☺ #### 感谢JetBrains 的支持 ##### JetBrains:[https://www.jetbrains.com/?from=AJ-Captcha](https://www.jetbrains.com/?from=AJ-Captcha "链接")
# Stargazers over time [![Stargazers over time](https://whnb.wang/img/anji-plus/captcha?e=604800)](https://whnb.wang/anji-plus/captcha?e=604800) [![Stargazers over time](https://starchart.cc/anji-plus/captcha.svg)](https://starchart.cc/anji-plus/captcha)