SpringBoot中集成kaptcha验证码
1.kaptcha相关介绍
Kaptcha是一个基于SimpleCaptcha的验证码开源项目。
2.集成方案
①pom.xml中配置依赖
<!-- 验证码-->
<dependency>
<groupId>com.github.penggle</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
②配置验证码Kaptcha相关设置
@Configuration
public class kaptchaConfig {
@Bean(name="captchaProducer")
public DefaultKaptcha getKaptchaBean(){
DefaultKaptcha defaultKaptcha=new DefaultKaptcha();
Properties properties=new Properties();
properties.setProperty("kaptcha.border", "yes");
properties.setProperty("kaptcha.border.color", "105,179,90");
properties.setProperty("kaptcha.textproducer.font.color", "blue");
properties.setProperty("kaptch
还没有评论,来说两句吧...