use of com.cdeledu.model.rbac.SysUser in project wechat by dllwh.
the class LoginFilter method isAccessAllowed.
/**
* ----------------------------------------------------- Fields end
*/
@Override
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
SysUser token = ShiroHelper.getPrincipal();
if (token != null || isLoginRequest(request, response)) {
return Boolean.TRUE;
}
if (FilterHelper.isAjax(request)) {
Map<String, Object> resultMap = new HashMap<String, Object>();
if (logger.isDebugEnabled()) {
logger.debug("当前用户没有登录,并且是Ajax请求!");
}
HttpServletResponse httpresponse = (HttpServletResponse) response;
httpresponse.setHeader("sessionstatus", "timeout");
resultMap.put("success", false);
resultMap.put("resultCode", 10001);
resultMap.put("msg", "当前用户没有登录,需要重新登录");
FilterHelper.out(response, resultMap);
return Boolean.FALSE;
}
return Boolean.FALSE;
}
Aggregations