update 优化 登录用户缓存 去除冗余统一存储

feature/model
疯狂的狮子Li 1 year ago
parent 84429206dc
commit b4cbefd2b8

@ -52,7 +52,7 @@ public class LoginHelper {
StpUtil.login(loginUser.getLoginId(),
model.setExtra(TENANT_KEY, loginUser.getTenantId())
.setExtra(USER_KEY, loginUser.getUserId()));
StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser);
StpUtil.getSession().set(LOGIN_USER_KEY, loginUser);
}
/**
@ -63,7 +63,7 @@ public class LoginHelper {
if (loginUser != null) {
return loginUser;
}
SaSession session = StpUtil.getTokenSession();
SaSession session = StpUtil.getSession();
if (ObjectUtil.isNull(session)) {
return null;
}
@ -76,7 +76,8 @@ public class LoginHelper {
* token
*/
public static LoginUser getLoginUser(String token) {
SaSession session = StpUtil.getTokenSessionByToken(token);
Object loginId = StpUtil.getLoginIdByToken(token);
SaSession session = StpUtil.getSessionByLoginId(loginId);
if (ObjectUtil.isNull(session)) {
return null;
}

Loading…
Cancel
Save