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
0cd4ff90
Commit
0cd4ff90
authored
Jun 10, 2020
by
ZhengJie
Browse files
[代码完成](v2.5): 代码优化,验证码改为算术类型,长度改为2位
parent
4daaf61f
Changes
5
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityConfig.java
View file @
0cd4ff90
...
...
@@ -131,7 +131,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
}
private
Map
<
String
,
Set
<
String
>>
getAnonymousUrl
(
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
)
{
Map
<
String
,
Set
<
String
>>
anonymousUrls
=
new
HashMap
<>();
Map
<
String
,
Set
<
String
>>
anonymousUrls
=
new
HashMap
<>(
6
);
Set
<
String
>
get
=
new
HashSet
<>();
Set
<
String
>
post
=
new
HashSet
<>();
Set
<
String
>
put
=
new
HashSet
<>();
...
...
eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java
View file @
0cd4ff90
...
...
@@ -19,14 +19,12 @@ package me.zhengjie.modules.security.config.bean;
import
com.wf.captcha.*
;
import
com.wf.captcha.base.Captcha
;
import
me.zhengjie.exception.BadConfigurationException
;
import
java.util.Objects
;
/**
* 配置文件读取
*
* @author: liaojinlong
* @date: loginCode.length0loginCode.length0/6/10 17:loginCode.length6
* @author liaojinlong
* @date loginCode.length0loginCode.length0/6/10 17:loginCode.length6
*/
public
class
LoginProperties
{
...
...
@@ -65,8 +63,7 @@ public class LoginProperties {
loginCode
.
setCodeType
(
LoginCodeEnum
.
arithmetic
);
}
}
Captcha
captcha
=
switchCaptcha
(
loginCode
);
return
captcha
;
return
switchCaptcha
(
loginCode
);
}
/**
...
...
@@ -100,6 +97,7 @@ public class LoginProperties {
case
spec:
captcha
=
new
SpecCaptcha
(
loginCode
.
getWidth
(),
loginCode
.
getHeight
());
captcha
.
setLen
(
loginCode
.
getLength
());
break
;
default
:
throw
new
BadConfigurationException
(
"验证码配置信息错误!!!正确配置查看 me.zhengjie.modules.security.config.bean.LoginCodeEnum "
);
}
...
...
eladmin-system/src/main/resources/config/application-dev.yml
View file @
0cd4ff90
...
...
@@ -50,8 +50,8 @@ login:
single
:
false
# 验证码
login-code
:
# 验证码类型配置
code-type
:
chinese_gif
# 验证码类型配置
查看 LoginProperties 类
code-type
:
arithmetic
# 登录图形验证码有效时间/分钟
expiration
:
2
# 验证码高度
...
...
@@ -59,7 +59,7 @@ login:
# 验证码宽度
heigth
:
36
# 内容长度
length
:
3
length
:
2
#jwt
jwt
:
...
...
@@ -91,7 +91,6 @@ swagger:
ip
:
local-parsing
:
true
# 文件存储路径
file
:
mac
:
...
...
eladmin-system/src/main/resources/config/application-prod.yml
View file @
0cd4ff90
...
...
@@ -52,7 +52,7 @@ login:
single
:
false
# 验证码
login-code
:
# 验证码类型配置
# 验证码类型配置
查看 LoginProperties 类
code-type
:
chinese_gif
# 登录图形验证码有效时间/分钟
expiration
:
2
...
...
@@ -61,7 +61,7 @@ login:
# 验证码宽度
heigth
:
36
# 内容长度
length
:
3
length
:
2
#jwt
jwt
:
...
...
eladmin-system/src/main/resources/config/application.yml
View file @
0cd4ff90
...
...
@@ -50,23 +50,6 @@ qiniu:
code
:
expiration
:
300
# 登录相关配置
login
:
# 是否限制单用户登录
single
:
false
# 验证码
login-code
:
# 验证码类型配置
code-type
:
chinese_gif
# 登录图形验证码有效时间/分钟
expiration
:
2
# 验证码高度
width
:
111
# 验证码宽度
heigth
:
36
# 内容长度
length
:
3
#密码加密传输,前端公钥加密,后端私钥解密
rsa
:
private_key
:
MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
...
...
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