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
72148f1f
Commit
72148f1f
authored
Jul 12, 2022
by
Zheng Jie
Browse files
Merge branch 'master' into deploy
parents
3241e84f
40177c6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java
View file @
72148f1f
...
@@ -68,33 +68,31 @@ public class LoginProperties {
...
@@ -68,33 +68,31 @@ 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
captcha
=
new
FixedArithmeticCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
=
new
FixedArithmeticCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
// 几位数运算,默认是两位
// 几位数运算,默认是两位
captcha
.
setLen
(
loginCode
.
getLength
());
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
break
;
case
CHINESE:
case
CHINESE:
captcha
=
new
ChineseCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
=
new
ChineseCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
.
setLen
(
loginCode
.
getLength
());
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
break
;
case
CHINESE_GIF:
case
CHINESE_GIF:
captcha
=
new
ChineseGifCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
=
new
ChineseGifCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
.
setLen
(
loginCode
.
getLength
());
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
break
;
case
GIF:
case
GIF:
captcha
=
new
GifCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
=
new
GifCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
.
setLen
(
loginCode
.
getLength
());
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
break
;
case
SPEC:
case
SPEC:
captcha
=
new
SpecCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
=
new
SpecCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
.
setLen
(
loginCode
.
getLength
());
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
break
;
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