|
|
|
@ -50,10 +50,13 @@ public class CaptchaConfig
|
|
|
|
Properties properties = new Properties();
|
|
|
|
Properties properties = new Properties();
|
|
|
|
// 是否有边框 默认为true 我们可以自己设置yes,no
|
|
|
|
// 是否有边框 默认为true 我们可以自己设置yes,no
|
|
|
|
properties.setProperty(KAPTCHA_BORDER, "yes");
|
|
|
|
properties.setProperty(KAPTCHA_BORDER, "yes");
|
|
|
|
// 边框颜色 默认为Color.BLACK
|
|
|
|
// 边框颜色 修改为科技蓝
|
|
|
|
properties.setProperty(KAPTCHA_BORDER_COLOR, "105,179,90");
|
|
|
|
properties.setProperty(KAPTCHA_BORDER_COLOR, "64,158,255");
|
|
|
|
// 验证码文本字符颜色 默认为Color.BLACK
|
|
|
|
// 验证码文本字符颜色 修改为白色适配深色背景
|
|
|
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "blue");
|
|
|
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "255,255,255");
|
|
|
|
|
|
|
|
//背景颜色渐变 修改为统一的深蓝科技感背景
|
|
|
|
|
|
|
|
properties.setProperty(KAPTCHA_BACKGROUND_CLR_FROM, "28,132,198");
|
|
|
|
|
|
|
|
properties.setProperty(KAPTCHA_BACKGROUND_CLR_TO, "28,132,198");
|
|
|
|
// 验证码图片宽度 默认为200
|
|
|
|
// 验证码图片宽度 默认为200
|
|
|
|
properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
|
|
|
|
properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
|
|
|
|
// 验证码图片高度 默认为50
|
|
|
|
// 验证码图片高度 默认为50
|
|
|
|
@ -70,8 +73,8 @@ public class CaptchaConfig
|
|
|
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6");
|
|
|
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6");
|
|
|
|
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
|
|
|
|
// 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
|
|
|
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
|
|
|
|
properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
|
|
|
|
// 验证码噪点颜色 默认为Color.BLACK
|
|
|
|
// 验证码噪点颜色 修改为科技蓝
|
|
|
|
properties.setProperty(KAPTCHA_NOISE_COLOR, "white");
|
|
|
|
properties.setProperty(KAPTCHA_NOISE_COLOR, "64,158,255");
|
|
|
|
// 干扰实现类
|
|
|
|
// 干扰实现类
|
|
|
|
properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");
|
|
|
|
properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");
|
|
|
|
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
|
|
|
|
// 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
|
|
|
|
@ -80,4 +83,5 @@ public class CaptchaConfig
|
|
|
|
defaultKaptcha.setConfig(config);
|
|
|
|
defaultKaptcha.setConfig(config);
|
|
|
|
return defaultKaptcha;
|
|
|
|
return defaultKaptcha;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|