系统用户会话命名sysUser

dep_wangsr
RuoYi 6 years ago committed by Limy
parent 80c4ad58d6
commit 69268ee915

@ -60,7 +60,7 @@ public class DataScopeAspect
return; return;
} }
// 获取当前的用户 // 获取当前的用户
SysUser currentUser = ShiroUtils.getUser(); SysUser currentUser = ShiroUtils.getSysUser();
if (currentUser != null) if (currentUser != null)
{ {
// 如果是超级管理员,则不过滤数据 // 如果是超级管理员,则不过滤数据

@ -75,7 +75,7 @@ public class LogAspect
} }
// 获取当前的用户 // 获取当前的用户
SysUser currentUser = ShiroUtils.getUser(); SysUser currentUser = ShiroUtils.getSysUser();
// *========数据库日志=========*// // *========数据库日志=========*//
SysOperLog operLog = new SysOperLog(); SysOperLog operLog = new SysOperLog();

@ -55,7 +55,7 @@ public class UserRealm extends AuthorizingRealm
@Override @Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0) protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection arg0)
{ {
SysUser user = ShiroUtils.getUser(); SysUser user = ShiroUtils.getSysUser();
// 角色列表 // 角色列表
Set<String> roles = new HashSet<String>(); Set<String> roles = new HashSet<String>();
// 功能列表 // 功能列表

@ -47,7 +47,7 @@ public class LogoutFilter extends org.apache.shiro.web.filter.authc.LogoutFilter
String redirectUrl = getRedirectUrl(request, response, subject); String redirectUrl = getRedirectUrl(request, response, subject);
try try
{ {
SysUser user = ShiroUtils.getUser(); SysUser user = ShiroUtils.getSysUser();
if (StringUtils.isNotNull(user)) if (StringUtils.isNotNull(user))
{ {
String loginName = user.getLoginName(); String loginName = user.getLoginName();

@ -53,7 +53,7 @@ public class OnlineSessionFilter extends AccessControlFilter
boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L; boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L;
if (isGuest == true) if (isGuest == true)
{ {
SysUser user = ShiroUtils.getUser(); SysUser user = ShiroUtils.getSysUser();
if (user != null) if (user != null)
{ {
onlineSession.setUserId(user.getUserId()); onlineSession.setUserId(user.getUserId());

@ -32,7 +32,7 @@ public class ShiroUtils
getSubjct().logout(); getSubjct().logout();
} }
public static SysUser getUser() public static SysUser getSysUser()
{ {
SysUser user = null; SysUser user = null;
Object obj = getSession().getAttribute("sysUser"); Object obj = getSession().getAttribute("sysUser");
@ -58,12 +58,12 @@ public class ShiroUtils
public static Long getUserId() public static Long getUserId()
{ {
return getUser().getUserId().longValue(); return getSysUser().getUserId().longValue();
} }
public static String getLoginName() public static String getLoginName()
{ {
return getUser().getLoginName(); return getSysUser().getLoginName();
} }
public static String getIp() public static String getIp()

Loading…
Cancel
Save