首页>代码>基于SpringBoot框架开发的简单商城后台管理系统>/myshop/src/main/java/com/jacklin/myshop/config/KaptchaConfig.java
package com.jacklin.myshop.config; import com.google.code.kaptcha.Producer; import com.google.code.kaptcha.util.Config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.Properties; /** * 验证码框架配置 */ @Configuration public class KaptchaConfig { @Bean public Producer KaptchaProducer() { Properties kaptchaProperties = new Properties(); kaptchaProperties.put("kaptcha.border", "no"); kaptchaProperties.put("kaptcha.textproducer.char.length", "4"); kaptchaProperties.put("kaptcha.textproducer.char.space", "6"); kaptchaProperties.put("kaptcha.image.height", "80"); // kaptchaProperties.put("kaptcha.image.width","125"); kaptchaProperties.put("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.WaterRipple"); kaptchaProperties.put("kaptcha.textproducer.font.color", "blue"); kaptchaProperties.put("kaptcha.textproducer.font.size", "60"); //kaptchaProperties.put("kaptcha.noise.impl","com.google.code.kaptcha.impl.NoNoise"); kaptchaProperties.put("kaptcha.noise.impl", "com.google.code.kaptcha.impl.DefaultNoise"); kaptchaProperties.put("kaptcha.textproducer.char.string", "123456789"); Config config = new Config(kaptchaProperties); return config.getProducerImpl(); } }
最近下载更多
最近浏览更多
luo17017
3月25日
暂无贡献等级
qq549888060 LV8
3月24日
LHLHBBA
3月19日
暂无贡献等级
15103432984 LV2
3月16日
jay1992 LV14
3月11日
wbw123 LV4
3月1日
407129151 LV6
2月18日
nvcore LV1
2月1日
lan9277
1月11日
暂无贡献等级
2897744513 LV2
2023年12月30日