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
RuoYi Vue
Commits
cef26e77
Commit
cef26e77
authored
Nov 20, 2019
by
RuoYi
Browse files
系统退出删除用户缓存记录
parent
9f97fd09
Changes
2
Hide whitespace changes
Inline
Side-by-side
ruoyi/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
View file @
cef26e77
...
...
@@ -43,6 +43,8 @@ public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
if
(
StringUtils
.
isNotNull
(
loginUser
))
{
String
userName
=
loginUser
.
getUsername
();
// 删除用户缓存记录
tokenService
.
delLoginUser
(
loginUser
.
getToken
());
// 记录用户退出日志
AsyncManager
.
me
().
execute
(
AsyncFactory
.
recordLogininfor
(
userName
,
Constants
.
LOGOUT
,
"退出成功"
));
}
...
...
ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java
View file @
cef26e77
...
...
@@ -82,6 +82,18 @@ public class TokenService
}
}
/**
* 删除用户身份信息
*/
public
void
delLoginUser
(
String
token
)
{
if
(
StringUtils
.
isNotEmpty
(
token
))
{
String
userKey
=
getTokenKey
(
token
);
redisCache
.
deleteObject
(
userKey
);
}
}
/**
* 创建令牌
*
...
...
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