alexxiyang / shiro-redis

shiro only provide the support of ehcache and concurrentHashMap. Here is an implement of redis cache can be used by shiro. Hope it will help you!
MIT License
1.17k stars 446 forks source link

shiro 保存权限信息 redis存储的SimpleAuthorizationInfo 结果乱码 #141

Open NMY-Y opened 3 years ago

NMY-Y commented 3 years ago

1.使用springboot + redis +shiro + shiro-redis

  1. shiro自定义缓存实现,使用redisCacheManager ,使用的使shiro-redis的RedisCacheManager image

  2. 序列化时redis结果乱码,有没有配置序列化的方法

  3. image `key:shiro:cache:org.spring.nmy.shiroredis.shiro.MyRealm.authorizationCache:1,

value: \xAC\xED\x00\x05sr\x00.org.apache.shiro.authz.SimpleAuthorizationInfoY\xEBJ\xD6^\xD0-T\x02\x00\x03L\x00\x11objectPermissionst\x00\x0FLjava/util/Set;L\x00\x05rolesq\x00~\x00\x01L\x00\x11stringPermissionsq\x00~\x00\x01xppsr\x00\x11java.util.HashSet\xBAD\x85\x95\x96\xB8\xB74\x03\x00\x00xpw\x0C\x00\x00\x00\x10?@\x00\x00\x00\x00\x00\x01t\x00\x05adminxsq\x00~\x00\x03w\x0C\x00\x00\x00\x10?@\x00\x00\x00\x00\x00\x01t\x00\x0Ctest:list123x `