Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JAVA小学生-王铁柱
eladmin
提交
cad0c08c
E
eladmin
项目概览
JAVA小学生-王铁柱
/
eladmin
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
eladmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cad0c08c
编写于
10月 27, 2019
作者:
D
dqjdda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
bb5cc6f6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
12 addition
and
5 deletion
+12
-5
eladmin-system/src/main/java/me/zhengjie/modules/monitor/service/impl/RedisServiceImpl.java
...engjie/modules/monitor/service/impl/RedisServiceImpl.java
+5
-2
eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthenticationController.java
...ngjie/modules/security/rest/AuthenticationController.java
+3
-3
eladmin-system/src/main/resources/config/application-dev.yml
eladmin-system/src/main/resources/config/application-dev.yml
+2
-0
eladmin-system/src/main/resources/config/application-prod.yml
...min-system/src/main/resources/config/application-prod.yml
+2
-0
未找到文件。
eladmin-system/src/main/java/me/zhengjie/modules/monitor/service/impl/RedisServiceImpl.java
浏览文件 @
cad0c08c
...
...
@@ -30,6 +30,9 @@ public class RedisServiceImpl implements RedisService {
@Value
(
"${jwt.online}"
)
private
String
onlineKey
;
@Value
(
"${jwt.codeKey}"
)
private
String
codeKey
;
public
RedisServiceImpl
(
RedisTemplate
redisTemplate
)
{
this
.
redisTemplate
=
redisTemplate
;
}
...
...
@@ -43,7 +46,7 @@ public class RedisServiceImpl implements RedisService {
Set
<
String
>
keys
=
redisTemplate
.
keys
(
key
);
for
(
String
s
:
keys
)
{
// 过滤掉权限的缓存
if
(
s
.
contains
(
"role::loadPermissionByUser"
)
||
s
.
contains
(
"user::loadUserByUsername"
)
||
s
.
contains
(
onlineKey
))
{
if
(
s
.
contains
(
"role::loadPermissionByUser"
)
||
s
.
contains
(
"user::loadUserByUsername"
)
||
s
.
contains
(
onlineKey
)
||
s
.
contains
(
codeKey
)
)
{
continue
;
}
RedisVo
redisVo
=
new
RedisVo
(
s
,
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
s
)).
toString
());
...
...
@@ -63,7 +66,7 @@ public class RedisServiceImpl implements RedisService {
@Override
public
void
deleteAll
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
"*"
);
redisTemplate
.
delete
(
keys
.
stream
().
filter
(
s
->
!
s
.
contains
(
onlineKey
)).
collect
(
Collectors
.
toList
()));
redisTemplate
.
delete
(
keys
.
stream
().
filter
(
s
->
!
s
.
contains
(
onlineKey
)).
filter
(
s
->
!
s
.
contains
(
codeKey
)).
collect
(
Collectors
.
toList
()));
}
@Override
...
...
eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthenticationController.java
浏览文件 @
cad0c08c
...
...
@@ -38,8 +38,8 @@ import javax.servlet.http.HttpServletRequest;
@Api
(
tags
=
"系统:系统授权接口"
)
public
class
AuthenticationController
{
@Value
(
"${jwt.
online
}"
)
private
String
onlin
eKey
;
@Value
(
"${jwt.
codeKey
}"
)
private
String
cod
eKey
;
private
final
JwtTokenUtil
jwtTokenUtil
;
...
...
@@ -104,7 +104,7 @@ public class AuthenticationController {
captcha
.
setLen
(
2
);
// 获取运算的结果:5
String
result
=
captcha
.
text
();
String
uuid
=
onlin
eKey
+
IdUtil
.
simpleUUID
();
String
uuid
=
cod
eKey
+
IdUtil
.
simpleUUID
();
redisService
.
saveCode
(
uuid
,
result
);
return
new
ImgResult
(
captcha
.
toBase64
(),
uuid
);
}
...
...
eladmin-system/src/main/resources/config/application-dev.yml
浏览文件 @
cad0c08c
...
...
@@ -49,6 +49,8 @@ jwt:
expiration
:
21600000
# 在线用户key
online
:
online-token
# 验证码
codeKey
:
code-key
#是否允许生成代码,生产环境设置为false
generator
:
...
...
eladmin-system/src/main/resources/config/application-prod.yml
浏览文件 @
cad0c08c
...
...
@@ -51,6 +51,8 @@ jwt:
expiration
:
7200000
# 在线用户key
online
:
online-token
# 验证码
codeKey
:
code-key
#是否允许生成代码,生产环境设置为false
generator
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录