首页>代码>基于SpringBoot+Vue实现的小区物业管理系统>/em_server/src/main/java/com/kum/config/CaptchaConfig.java
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;
    }

}
最近下载更多
ma406805131  LV12 5月7日
jsjsjsjsbdbshns  LV1 4月27日
860421  LV3 4月18日
YhXyHx523  LV6 4月13日
denglu123321  LV4 4月11日
dapeng0011  LV13 4月6日
玖零定制问题修复  LV34 4月4日
zolscy  LV12 3月24日
最近浏览更多
zch123456  LV1 5月9日
飃go with wind 5月7日
暂无贡献等级
jinglang  LV11 5月7日
ma406805131  LV12 5月7日
luoxiaobao  LV5 4月29日
jsjsjsjsbdbshns  LV1 4月27日
2775645521  LV5 4月23日
之额着  LV3 4月22日
暂无贡献等级
860421  LV3 4月18日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友