最近搞这块儿的东西,整个流程倒是实现了,遇到一个问题,涉及到 shiro 的源码,具体问题是:shiro 的 Session 类通过序列化存储在 redis 的时候,Session 的某些字段丢失了,我看了它的实现类 SimpleSession,丢失的字段被 transient 修饰了,导致这些字段没被序列化,问题来了,login 之后,session 被保存了,其他接口请求的时候,shiro 会去 redis 里获取该用户的 session,然后 sessionId 丢失了,报了如下异常:java.lang.IllegalArgumentException: The org.apache.shiro.session.mgt.DelegatingSession implementation requires that the SessionKey argument returns a non-null sessionId to support the Session.getId() invocations.
