From 0d0fbd87f6ce50f3100bd2497bb524aaca641f4e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 14 Dec 2018 12:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E9=97=B4=E8=B7=9D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/config/CaptchaConfig.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java index 653b7e0c..0be4fcaa 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java @@ -19,16 +19,27 @@ public class CaptchaConfig { DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); Properties properties = new Properties(); + // 是否有边框 默认为true 我们可以自己设置yes,no properties.setProperty("kaptcha.border", "yes"); + // 边框颜色 默认为Color.BLACK properties.setProperty("kaptcha.border.color", "105,179,90"); + // 验证码文本字符颜色 默认为Color.BLACK properties.setProperty("kaptcha.textproducer.font.color", "blue"); + // 验证码图片宽度 默认为200 properties.setProperty("kaptcha.image.width", "160"); + // 验证码图片高度 默认为50 properties.setProperty("kaptcha.image.height", "60"); - properties.setProperty("kaptcha.textproducer.font.size", "28"); + // 验证码文本字符大小 默认为40 + properties.setProperty("kaptcha.textproducer.font.size", "30"); + // KAPTCHA_SESSION_KEY properties.setProperty("kaptcha.session.key", "kaptchaCode"); - properties.setProperty("kaptcha.textproducer.char.spac", "35"); + // 验证码文本字符间距 默认为2 + properties.setProperty("kaptcha.textproducer.char.space", "3"); + // 验证码文本字符长度 默认为5 properties.setProperty("kaptcha.textproducer.char.length", "5"); + // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize) properties.setProperty("kaptcha.textproducer.font.names", "Arial,Courier"); + // 验证码噪点颜色 默认为Color.BLACK properties.setProperty("kaptcha.noise.color", "white"); Config config = new Config(properties); defaultKaptcha.setConfig(config);