shiro.ini
/** = autol,authc
//autol 代码
public class AutoLoginFilter extends AccessControlFilter {
private static final Log log = Logs.get();
@Override
public boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
Subject subject = getSubject(request, response);
if(subject == null) {
return super.onPreHandle(request, response, mappedValue);
}
//自动登陆
autoLogin(subject);
return super.onPreHandle(request, response, mappedValue);
}
private void autoLogin(Subject subject) {
//...
}
@Override
protected boolean isAccessAllowed(ServletRequest servletRequest, ServletResponse servletResponse, Object o) throws Exception {
return true;
}
@Override
protected boolean onAccessDenied(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
return true;
}
}