首页>代码>基于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();
    }
}
最近下载更多
15578157792  LV7 2024年10月24日
artemiszer0  LV2 2024年7月4日
zhezhizzzz  LV2 2024年6月29日
TY0165  LV20 2024年6月26日
计科一班  LV7 2024年6月18日
yyhrhv  LV8 2024年5月30日
llllllK  LV5 2024年5月13日
Luck_ZDM  LV12 2024年4月12日
jay1992  LV14 2024年3月11日
nvcore  LV1 2024年2月1日
最近浏览更多
sn764889012 4月16日
暂无贡献等级
cainiao1101 2月11日
暂无贡献等级
王愉悦  LV4 2024年12月3日
haomc052829  LV4 2024年12月3日
yoyo123  LV1 2024年11月26日
wanglonggggg 2024年11月8日
暂无贡献等级
yangchengshuai  LV15 2024年10月29日
15578157792  LV7 2024年10月24日
bluerstar  LV1 2024年10月23日
hhr1101  LV2 2024年10月21日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友