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
34024a25
Commit
34024a25
authored
Jul 10, 2020
by
dbdu
Browse files
Merge branch 'master' of
https://gitee.com/elunez/eladmin
parents
cf1e17c7
538e7a6e
Changes
5
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java
View file @
34024a25
...
...
@@ -28,6 +28,7 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
public
class
ConfigBeanConfiguration
{
@Bean
@ConfigurationProperties
(
prefix
=
"login"
,
ignoreUnknownFields
=
true
)
public
LoginProperties
loginProperties
()
{
...
...
eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java
View file @
34024a25
...
...
@@ -15,13 +15,17 @@
*/
package
me.zhengjie.modules.security.config.bean
;
import
lombok.Data
;
/**
* 登录验证码配置信息
*
* @author: liaojinlong
* @date: 2020/6/10 18:53
*/
@Data
public
class
LoginCode
{
/**
* 验证码配置
*/
...
...
@@ -42,44 +46,16 @@ public class LoginCode {
* 验证码高度
*/
private
int
height
=
36
;
/**
* 验证码字体
*/
private
String
fontName
;
/**
* 字体大小
*/
private
int
fontSize
=
25
;
public
LoginCodeEnum
getCodeType
()
{
return
codeType
;
}
public
void
setCodeType
(
LoginCodeEnum
codeType
)
{
this
.
codeType
=
codeType
;
}
public
Long
getExpiration
()
{
return
expiration
;
}
public
void
setExpiration
(
Long
expiration
)
{
this
.
expiration
=
expiration
;
}
public
int
getLength
()
{
return
length
;
}
public
void
setLength
(
int
length
)
{
this
.
length
=
length
;
}
public
int
getWidth
()
{
return
width
;
}
public
void
setWidth
(
int
width
)
{
this
.
width
=
width
;
}
public
int
getHeight
()
{
return
height
;
}
public
void
setHeight
(
int
height
)
{
this
.
height
=
height
;
}
}
eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java
View file @
34024a25
...
...
@@ -15,11 +15,13 @@
*/
package
me.zhengjie.modules.security.config.bean
;
import
com.wf.captcha.*
;
import
com.wf.captcha.base.Captcha
;
import
lombok.Data
;
import
me.zhengjie.exception.BadConfigurationException
;
import
me.zhengjie.utils.StringUtils
;
import
java.awt.*
;
import
java.util.Objects
;
/**
...
...
@@ -28,6 +30,7 @@ import java.util.Objects;
* @author liaojinlong
* @date loginCode.length0loginCode.length0/6/10 17:loginCode.length6
*/
@Data
public
class
LoginProperties
{
/**
...
...
@@ -45,26 +48,10 @@ public class LoginProperties {
return
singleLogin
;
}
public
void
setSingleLogin
(
boolean
singleLogin
)
{
this
.
singleLogin
=
singleLogin
;
}
public
LoginCode
getLoginCode
()
{
return
loginCode
;
}
public
void
setLoginCode
(
LoginCode
loginCode
)
{
this
.
loginCode
=
loginCode
;
}
public
boolean
isCacheEnable
()
{
return
cacheEnable
;
}
public
void
setCacheEnable
(
boolean
cacheEnable
)
{
this
.
cacheEnable
=
cacheEnable
;
}
/**
* 获取验证码生产类
*
...
...
@@ -113,9 +100,12 @@ public class LoginProperties {
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
default
:
throw
new
BadConfigurationException
(
"验证码配置信息错误!
!!
正确配置查看
me.zhengjie.modules.security.config.bean.
LoginCodeEnum "
);
throw
new
BadConfigurationException
(
"验证码配置信息错误!正确配置查看 LoginCodeEnum "
);
}
}
if
(
StringUtils
.
isNotBlank
(
loginCode
.
getFontName
())){
captcha
.
setFont
(
new
Font
(
loginCode
.
getFontName
(),
Font
.
PLAIN
,
loginCode
.
getFontSize
()));
}
return
captcha
;
}
}
eladmin-system/src/main/resources/config/application-dev.yml
View file @
34024a25
...
...
@@ -62,6 +62,10 @@ login:
heigth
:
36
# 内容长度
length
:
2
# 字体名称,为空则使用默认字体
font-name
:
# 字体大小
font-size
:
25
#jwt
jwt
:
...
...
eladmin-system/src/main/resources/config/application-prod.yml
View file @
34024a25
...
...
@@ -55,7 +55,7 @@ login:
# 验证码
login-code
:
# 验证码类型配置 查看 LoginProperties 类
code-type
:
chinese_gif
code-type
:
arithmetic
# 登录图形验证码有效时间/分钟
expiration
:
2
# 验证码高度
...
...
@@ -64,6 +64,10 @@ login:
heigth
:
36
# 内容长度
length
:
2
# 字体名称,为空则使用默认字体,如遇到线上乱码,设置其他字体即可
font-name
:
# 字体大小
font-size
:
25
#jwt
jwt
:
...
...
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