diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java index 1e00f2fe..164c0073 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java @@ -68,33 +68,31 @@ public class LoginProperties { */ private Captcha switchCaptcha(LoginCode loginCode) { Captcha captcha; - synchronized (this) { - switch (loginCode.getCodeType()) { - case ARITHMETIC: - // 算术类型 https://gitee.com/whvse/EasyCaptcha - captcha = new FixedArithmeticCaptcha(loginCode.getWidth(), loginCode.getHeight()); - // 几位数运算,默认是两位 - captcha.setLen(loginCode.getLength()); - break; - case CHINESE: - captcha = new ChineseCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - case CHINESE_GIF: - captcha = new ChineseGifCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - case GIF: - captcha = new GifCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - case SPEC: - captcha = new SpecCaptcha(loginCode.getWidth(), loginCode.getHeight()); - captcha.setLen(loginCode.getLength()); - break; - default: - throw new BadConfigurationException("验证码配置信息错误!正确配置查看 LoginCodeEnum "); - } + switch (loginCode.getCodeType()) { + case ARITHMETIC: + // 算术类型 https://gitee.com/whvse/EasyCaptcha + captcha = new FixedArithmeticCaptcha(loginCode.getWidth(), loginCode.getHeight()); + // 几位数运算,默认是两位 + captcha.setLen(loginCode.getLength()); + break; + case CHINESE: + captcha = new ChineseCaptcha(loginCode.getWidth(), loginCode.getHeight()); + captcha.setLen(loginCode.getLength()); + break; + case CHINESE_GIF: + captcha = new ChineseGifCaptcha(loginCode.getWidth(), loginCode.getHeight()); + captcha.setLen(loginCode.getLength()); + break; + case GIF: + captcha = new GifCaptcha(loginCode.getWidth(), loginCode.getHeight()); + captcha.setLen(loginCode.getLength()); + break; + case SPEC: + captcha = new SpecCaptcha(loginCode.getWidth(), loginCode.getHeight()); + captcha.setLen(loginCode.getLength()); + break; + default: + throw new BadConfigurationException("验证码配置信息错误!正确配置查看 LoginCodeEnum "); } if(StringUtils.isNotBlank(loginCode.getFontName())){ captcha.setFont(new Font(loginCode.getFontName(), Font.PLAIN, loginCode.getFontSize()));