refactor: 优化后台登出的逻辑

This commit is contained in:
CaptainB 2022-12-03 13:31:28 +08:00 committed by 刘瑞斌
parent 087bcceca6
commit a02821bc74
1 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,9 @@ public class SSOLogoutService {
*/
public void logout(String sessionId, HttpServletResponse response) throws Exception {
Object obj = redisIndexedSessionRepository.findById(sessionId);
if (obj == null) {
return;
}
String authId = (String) MethodUtils.invokeMethod(obj, "getAttribute", "authId");
AuthSource authSource = authSourceMapper.selectByPrimaryKey(authId);
if (authSource != null) {