踢出用户时更新ehcash缓存

dep_wangsr
lsm121 6 years ago committed by Limy
parent 1b44cf7e2e
commit ce46cb1d35

@ -78,6 +78,7 @@ public class SysUserOnlineController extends BaseController
return error("当前登陆用户无法强退"); return error("当前登陆用户无法强退");
} }
onlineSession.setStatus(OnlineStatus.off_line); onlineSession.setStatus(OnlineStatus.off_line);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line); online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online); userOnlineService.saveOnline(online);
} }
@ -105,6 +106,7 @@ public class SysUserOnlineController extends BaseController
return error("用户已下线"); return error("用户已下线");
} }
onlineSession.setStatus(OnlineStatus.off_line); onlineSession.setStatus(OnlineStatus.off_line);
onlineSessionDAO.update(onlineSession);
online.setStatus(OnlineStatus.off_line); online.setStatus(OnlineStatus.off_line);
userOnlineService.saveOnline(online); userOnlineService.saveOnline(online);
return success(); return success();

@ -3,6 +3,7 @@ package com.ruoyi.framework.shiro.session;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import org.apache.shiro.session.Session; import org.apache.shiro.session.Session;
import org.apache.shiro.session.UnknownSessionException;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO; import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -54,6 +55,11 @@ public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
return sysShiroService.getSession(sessionId); return sysShiroService.getSession(sessionId);
} }
@Override
public void update(Session session) throws UnknownSessionException {
super.update(session);
}
/** /**
* 访/// * 访///
*/ */

Loading…
Cancel
Save