Skip to content

Commit

Permalink
update 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyuv committed Mar 3, 2023
1 parent 531f627 commit 1f66137
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 198 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@
## 安装
### 1.Maven
在项目的pom.xml的dependencies中加入以下内容:

spring mvc
```xml
<dependency>
<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```
spring boot 2
```xml
<dependency>
<groupId>com.xingyuv</groupId>
<artifactId>spring-boot-starter-captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```
spring boot 3
```xml
<dependency>
<groupId>com.xingyuv</groupId>
<artifactId>spring-boot-starter-captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion core/captcha-plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ a.引入jar,已上传至maven中央仓库。
<dependency>
<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
```
b.修改application.properties,自定义底图和水印,启动后前端就可以请求接口了。[社区底图库](https://gitee.com/anji-plus/AJ-Captcha-Images)
Expand Down
2 changes: 1 addition & 1 deletion core/captcha-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>captcha-plus.jar</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public enum CaptchaBaseMapEnum {
*/
PIC_CLICK("PIC_CLICK", "文字点选底图");

private String codeValue;
private String codeDesc;
private final String codeValue;
private final String codeDesc;

private CaptchaBaseMapEnum(String codeValue, String codeDesc) {
this.codeValue = codeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public enum CaptchaTypeEnum {
*/
DEFAULT("default", "默认");

private String codeValue;
private String codeDesc;
private final String codeValue;
private final String codeDesc;

private CaptchaTypeEnum(String codeValue, String codeDesc) {
this.codeValue = codeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public enum RepCodeEnum {
API_REQ_LOCK_GET_ERROR("6202", "接口验证失败数过多,请稍后再试"),
API_REQ_LIMIT_CHECK_ERROR("6204", "check接口请求次数超限,请稍后再试!"),
API_REQ_LIMIT_VERIFY_ERROR("6205", "verify请求次数超限!");
private String code;
private String desc;
private final String code;
private final String desc;

RepCodeEnum(String code, String desc) {
this.code = code;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public interface FrequencyLimitHandler {
* 1分钟内不超过600次
*/
class DefaultLimitHandler implements FrequencyLimitHandler {
private Properties config;
private CaptchaCacheService cacheService;
private final Properties config;
private final CaptchaCacheService cacheService;

public DefaultLimitHandler(Properties config, CaptchaCacheService cacheService) {
this.config = config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void run() {
refresh();
}
}, 0, second * 1000);*/
scheduledExecutor = new ScheduledThreadPoolExecutor(1, new ThreadFactory() {
ScheduledExecutorService scheduledExecutor = new ScheduledThreadPoolExecutor(1, new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
return new Thread(r, "thd-captcha-cache-clean");
Expand All @@ -53,8 +53,6 @@ public void run() {
}
}

private static ScheduledExecutorService scheduledExecutor;

/**
* 缓存刷新,清除过期数据
*/
Expand Down
8 changes: 4 additions & 4 deletions core/spring-boot-starter-captcha-plus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<version>2.7.9</version>
</parent>

<groupId>com.xingyuv</groupId>
<artifactId>spring-boot-starter-captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>

<name>spring-boot-starter-captcha-plus</name>
<description>spring-boot-starter-captcha-plus</description>
Expand All @@ -21,15 +21,15 @@

<properties>
<java.version>1.8</java.version>
<spring-boot-version>2.7.8</spring-boot-version>
<spring-boot-version>2.7.9</spring-boot-version>
</properties>

<!-- Add typical dependencies for a web application -->
<dependencies>
<dependency>
<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public CaptchaService captchaService(AjCaptchaProperties prop) {
config.put(Const.CAPTCHA_FONT_STYLE, prop.getFontStyle() + "");
config.put(Const.CAPTCHA_WORD_COUNT, prop.getClickWordCount() + "");

if ((StringUtils.isNotBlank(prop.getJigsaw()) && prop.getJigsaw().startsWith("classpath:"))
|| (StringUtils.isNotBlank(prop.getPicClick()) && prop.getPicClick().startsWith("classpath:"))) {
boolean judge = (StringUtils.isNotBlank(prop.getJigsaw()) && prop.getJigsaw().startsWith("classpath:"))
|| (StringUtils.isNotBlank(prop.getPicClick()) && prop.getPicClick().startsWith("classpath:"));

if (judge) {
//自定义resources目录下初始化底图
config.put(Const.CAPTCHA_INIT_ORIGINAL, "true");
initializeBaseMap(prop.getJigsaw(), prop.getPicClick());
Expand Down
6 changes: 0 additions & 6 deletions demo/springboot.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
*Copyright © 2018 anji-plus
*安吉加加信息技术有限公司
*http://www.anji-plus.com
*All rights reserved.
*/
package com.xingyuv.captcha.controller;

import com.xingyuv.captcha.model.common.ResponseModel;
Expand Down
6 changes: 0 additions & 6 deletions demo/springboot3.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
*Copyright © 2018 anji-plus
*安吉加加信息技术有限公司
*http://www.anji-plus.com
*All rights reserved.
*/
package com.xingyuv.captcha.controller;

import com.xingyuv.captcha.model.common.ResponseModel;
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<groupId>com.xingyuv</groupId>
<artifactId>captcha-plus-parent</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>
<packaging>pom</packaging>

<properties>
<springboot.version>2.7.8</springboot.version>
<captcha.core.version>1.0.2</captcha.core.version>
<springboot.version>2.7.9</springboot.version>
<captcha.core.version>1.0.3</captcha.core.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
Expand Down

0 comments on commit 1f66137

Please sign in to comment.