From 1d9dc73bda95e2369c3bab8985507d68e55c0485 Mon Sep 17 00:00:00 2001 From: "whvcse@foxmail.com" Date: Sun, 25 Aug 2019 11:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=86=85=E7=BD=AE=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E3=80=81=E8=B4=9D=E5=A1=9E=E5=B0=94=E6=9B=B2=E7=BA=BF?= =?UTF-8?q?=E3=80=81=E7=AE=97=E6=9C=AF=E9=AA=8C=E8=AF=81=E7=A0=81=E3=80=81?= =?UTF-8?q?base64=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 +++++++++---------- pom.xml | 2 +- .../com/wf/captcha/utils/CaptchaUtil.java | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5f930bd..7e4bbda 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ allprojects { 在项目的build.gradle中添加 ```text dependencies { - compile 'com.github.whvcse:EasyCaptcha:1.6.0' + compile 'com.github.whvcse:EasyCaptcha:1.6.1' } ``` @@ -83,22 +83,22 @@ dependencies { com.github.whvcse EasyCaptcha - 1.6.0 + 1.6.1 ``` ### 3.3.jar包下载 -[EasyCaptcha-1.6.0.jar](https://gitee.com/whvse/EasyCaptcha/releases) +[EasyCaptcha-1.6.1.jar](https://gitee.com/whvse/EasyCaptcha/releases) maven导入jar包,在项目根目录创建`libs`文件夹,然后pom.xml添加如下: ``` com.github.whvcse EasyCaptcha - 1.6.0 - ${basedir}/libs/EasyCaptcha-1.6.0.jar + 1.6.1 + ${basedir}/libs/EasyCaptcha-1.6.1.jar ``` @@ -230,21 +230,21 @@ public class Test { public static void main(String[] args) { // png类型 - SpecCaptcha captcha = new SpecCaptcha(130, 48, 5); + SpecCaptcha captcha = new SpecCaptcha(130, 48); captcha.text(); // 获取验证码的字符 captcha.textChar(); // 获取验证码的字符数组 // gif类型 - GifCaptcha captcha = new GifCaptcha(130, 48, 5); + GifCaptcha captcha = new GifCaptcha(130, 48); // 中文类型 - ChineseCaptcha captcha = new ChineseCaptcha(130, 48, 5); + ChineseCaptcha captcha = new ChineseCaptcha(130, 48); // 中文gif类型 - ChineseGifCaptcha captcha = new ChineseGifCaptcha(130, 48, 5); + ChineseGifCaptcha captcha = new ChineseGifCaptcha(130, 48); // 算术类型 - ArithmeticCaptcha captcha = new ArithmeticCaptcha(130, 48, 5); + ArithmeticCaptcha captcha = new ArithmeticCaptcha(130, 48); captcha.setLen(3); // 几位数运算,默认是两位 captcha.getArithmeticString(); // 获取运算的公式:3+2=? captcha.text(); // 获取运算的结果:5 @@ -357,7 +357,7 @@ public class CaptchaController { ``` 前端使用ajax获取验证码: ```html - + + ``` > RedisUtil到这里获取[https://gitee.com/whvse/RedisUtil](https://gitee.com/whvse/RedisUtil) @@ -391,7 +391,7 @@ public class CaptchaController { ## 8.更新日志 -- **2019-08-23 (v1.6.0)** +- **2019-08-23 (v1.6.1)** - 增加10种漂亮的内置字体,不依赖系统字体 - 增加算术验证码,运算位数可自由配置 diff --git a/pom.xml b/pom.xml index 7352603..d7d9683 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.wf easy-captcha - 1.6.0-RELEASE + 1.6.1-RELEASE jar EasyCaptcha diff --git a/src/main/java/com/wf/captcha/utils/CaptchaUtil.java b/src/main/java/com/wf/captcha/utils/CaptchaUtil.java index 2f04b54..5eed21c 100644 --- a/src/main/java/com/wf/captcha/utils/CaptchaUtil.java +++ b/src/main/java/com/wf/captcha/utils/CaptchaUtil.java @@ -115,7 +115,7 @@ public class CaptchaUtil { * @param response HttpServletResponse * @throws IOException IO异常 */ - private static void out(Captcha captcha, HttpServletRequest request, HttpServletResponse response) + public static void out(Captcha captcha, HttpServletRequest request, HttpServletResponse response) throws IOException { setHeader(response); request.getSession().setAttribute(SESSION_KEY, captcha.text().toLowerCase());