Unverified Commit 40177c6c authored by kdjj2006's avatar kdjj2006 Committed by GitHub
Browse files

获取验证码逻辑,无需加锁,不涉及线程安全问题,提高效率 (#755)

parent 255a3254
......@@ -68,7 +68,6 @@ public class LoginProperties {
*/
private Captcha switchCaptcha(LoginCode loginCode) {
Captcha captcha;
synchronized (this) {
switch (loginCode.getCodeType()) {
case ARITHMETIC:
// 算术类型 https://gitee.com/whvse/EasyCaptcha
......@@ -95,7 +94,6 @@ public class LoginProperties {
default:
throw new BadConfigurationException("验证码配置信息错误!正确配置查看 LoginCodeEnum ");
}
}
if(StringUtils.isNotBlank(loginCode.getFontName())){
captcha.setFont(new Font(loginCode.getFontName(), Font.PLAIN, loginCode.getFontSize()));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment