mirror of https://gitee.com/y_project/RuoYi.git
踢出用户时更新ehcash缓存
parent
2de9f07449
commit
3c92ab7463
|
@ -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…
Reference in New Issue