Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
40177c6c
Unverified
Commit
40177c6c
authored
Jul 12, 2022
by
kdjj2006
Committed by
GitHub
Jul 12, 2022
Browse files
获取验证码逻辑,无需加锁,不涉及线程安全问题,提高效率 (#755)
parent
255a3254
Changes
1
Show whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java
View file @
40177c6c
...
@@ -68,7 +68,6 @@ public class LoginProperties {
...
@@ -68,7 +68,6 @@ public class LoginProperties {
*/
*/
private
Captcha
switchCaptcha
(
LoginCode
loginCode
)
{
private
Captcha
switchCaptcha
(
LoginCode
loginCode
)
{
Captcha
captcha
;
Captcha
captcha
;
synchronized
(
this
)
{
switch
(
loginCode
.
getCodeType
())
{
switch
(
loginCode
.
getCodeType
())
{
case
ARITHMETIC:
case
ARITHMETIC:
// 算术类型 https://gitee.com/whvse/EasyCaptcha
// 算术类型 https://gitee.com/whvse/EasyCaptcha
...
@@ -95,7 +94,6 @@ public class LoginProperties {
...
@@ -95,7 +94,6 @@ public class LoginProperties {
default
:
default
:
throw
new
BadConfigurationException
(
"验证码配置信息错误!正确配置查看 LoginCodeEnum "
);
throw
new
BadConfigurationException
(
"验证码配置信息错误!正确配置查看 LoginCodeEnum "
);
}
}
}
if
(
StringUtils
.
isNotBlank
(
loginCode
.
getFontName
())){
if
(
StringUtils
.
isNotBlank
(
loginCode
.
getFontName
())){
captcha
.
setFont
(
new
Font
(
loginCode
.
getFontName
(),
Font
.
PLAIN
,
loginCode
.
getFontSize
()));
captcha
.
setFont
(
new
Font
(
loginCode
.
getFontName
(),
Font
.
PLAIN
,
loginCode
.
getFontSize
()));
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment