package com.kum.config; import com.google.code.kaptcha.impl.DefaultKaptcha; 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 CaptchaConfig { @Bean(name = "captchaProducer") public DefaultKaptcha getKaptcheCode() { DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); Properties properties = new Properties(); properties.setProperty("kaptcha.border", "no"); properties.setProperty("kaptcha.textproducer.font.color", "black"); properties.setProperty("kaptcha.image.width", "100"); properties.setProperty("kaptcha.image.height", "36"); properties.setProperty("kaptcha.textproducer.font.size", "30"); properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy"); properties.setProperty("kaptcha.session.key", "code"); properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise"); properties.setProperty("kaptcha.background.clear.from", "232,240,254"); properties.setProperty("kaptcha.background.clear.to", "232,240,254"); properties.setProperty("kaptcha.textproducer.char.length", "4"); properties.setProperty("kaptcha.textproducer.font.names", "彩云,宋体,楷体,微软雅黑"); Config config = new Config(properties); defaultKaptcha.setConfig(config); return defaultKaptcha; } }

luhong LV4
6月11日
萌萌哒的泰迪熊 LV4
5月8日
陈小灏 LV18
2月25日
102404426 LV8
2月24日
qq970040477 LV24
2024年12月5日
citybird LV4
2024年11月18日
sodkj123 LV16
2024年10月8日
ma406805131 LV19
2024年5月7日
jsjsjsjsbdbshns LV1
2024年4月27日
860421 LV3
2024年4月18日