vue2 新增行为验证码
							
								
								
									
										44
									
								
								yudao-framework/yudao-spring-boot-starter-captcha/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,44 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||
|          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
|          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
|     <parent> | ||||
|         <groupId>cn.iocoder.boot</groupId> | ||||
|         <artifactId>yudao-framework</artifactId> | ||||
|         <version>${revision}</version> | ||||
|     </parent> | ||||
|     <modelVersion>4.0.0</modelVersion> | ||||
|     <artifactId>yudao-spring-boot-starter-captcha</artifactId> | ||||
|     <packaging>jar</packaging> | ||||
|  | ||||
|     <name>${project.artifactId}</name> | ||||
|     <description> | ||||
|         验证码 | ||||
|     </description> | ||||
|  | ||||
|     <dependencies> | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|             <artifactId>yudao-common</artifactId> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- Spring 核心 --> | ||||
|         <dependency> | ||||
|             <groupId>org.springframework.boot</groupId> | ||||
|             <artifactId>spring-boot-starter</artifactId> | ||||
|         </dependency> | ||||
|  | ||||
|         <dependency> | ||||
|             <groupId>cn.iocoder.boot</groupId> | ||||
|             <artifactId>yudao-spring-boot-starter-redis</artifactId> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- 验证码相关 --> | ||||
|         <dependency> | ||||
|             <groupId>com.anji-plus</groupId> | ||||
|             <artifactId>spring-boot-starter-captcha</artifactId> | ||||
|         </dependency> | ||||
|  | ||||
|     </dependencies> | ||||
|  | ||||
| </project> | ||||
| @@ -0,0 +1,45 @@ | ||||
| package cn.iocoder.yudao.captcha.core.service; | ||||
|  | ||||
| import com.anji.captcha.service.CaptchaCacheService; | ||||
| import org.springframework.data.redis.core.StringRedisTemplate; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
| import java.util.concurrent.TimeUnit; | ||||
|  | ||||
| @Service | ||||
| public class CaptchaServiceImpl implements CaptchaCacheService { | ||||
|  | ||||
|     @Override | ||||
|     public String type() { | ||||
|         return "redis"; | ||||
|     } | ||||
|  | ||||
|     @Resource | ||||
|     private StringRedisTemplate stringRedisTemplate; | ||||
|  | ||||
|     @Override | ||||
|     public void set(String key, String value, long expiresInSeconds) { | ||||
|         stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean exists(String key) { | ||||
|         return Boolean.TRUE.equals(stringRedisTemplate.hasKey(key)); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void delete(String key) { | ||||
|         stringRedisTemplate.delete(key); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String get(String key) { | ||||
|         return stringRedisTemplate.opsForValue().get(key); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public Long increment(String key, long val) { | ||||
|         return stringRedisTemplate.opsForValue().increment(key,val); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1 @@ | ||||
| cn.iocoder.yudao.captcha.core.service.CaptchaServiceImpl | ||||
| After Width: | Height: | Size: 67 KiB | 
| After Width: | Height: | Size: 97 KiB | 
| After Width: | Height: | Size: 94 KiB | 
| After Width: | Height: | Size: 97 KiB | 
| After Width: | Height: | Size: 89 KiB | 
| After Width: | Height: | Size: 83 KiB | 
| After Width: | Height: | Size: 85 KiB | 
| After Width: | Height: | Size: 104 KiB | 
| After Width: | Height: | Size: 106 KiB | 
| After Width: | Height: | Size: 6.9 KiB | 
| After Width: | Height: | Size: 6.1 KiB | 
| After Width: | Height: | Size: 6.1 KiB | 
| After Width: | Height: | Size: 6.1 KiB | 
| After Width: | Height: | Size: 6.2 KiB | 
| After Width: | Height: | Size: 6.2 KiB | 
| After Width: | Height: | Size: 6.2 KiB | 
| After Width: | Height: | Size: 6.3 KiB | 
| After Width: | Height: | Size: 6.3 KiB | 
| After Width: | Height: | Size: 6.3 KiB | 
| After Width: | Height: | Size: 6.3 KiB | 
| After Width: | Height: | Size: 6.1 KiB | 
| After Width: | Height: | Size: 6.1 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 3.5 KiB | 
| After Width: | Height: | Size: 21 KiB | 
| After Width: | Height: | Size: 21 KiB | 
| After Width: | Height: | Size: 21 KiB | 
| After Width: | Height: | Size: 35 KiB | 
| After Width: | Height: | Size: 51 KiB | 
| After Width: | Height: | Size: 43 KiB | 
| After Width: | Height: | Size: 40 KiB | 
| After Width: | Height: | Size: 51 KiB | 
| After Width: | Height: | Size: 27 KiB | 
| After Width: | Height: | Size: 29 KiB | 
| After Width: | Height: | Size: 58 KiB | 
| After Width: | Height: | Size: 37 KiB | 
| After Width: | Height: | Size: 39 KiB | 
 xingyu
					xingyu