[代码完成](v2.5): 代码优化,验证码改为算术类型,长度改为2位

pull/410/head
ZhengJie 2020-06-10 21:07:20 +08:00
parent 4daaf61f40
commit 0cd4ff9047
5 changed files with 10 additions and 30 deletions

View File

@ -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<>();

View File

@ -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 ");
}

View File

@ -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:

View File

@ -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:

View File

@ -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==