1、cn.wizzer.common.core.Setup
//-------------Redis作为shiro二级缓存时启用这里---------
//JedisAgent jedisAgent = ioc.get(JedisAgent.class);
//LCacheManager.me().setJedisAgent(jedisAgent);
//RedisCache.DEBUG = true;
//-------------Redis作为shiro二级缓存时启用这里---------
2、src/main/resources/shiro.ini
;-------------Redis作为shiro二级缓存时启用这里---------
;cacheManager_ehcache = org.apache.shiro.cache.ehcache.EhCacheManager
;cacheManager_ehcache.cacheManagerConfigFile=classpath:ehcache.xml
;cacheManager_redis = org.nutz.plugins.cache.impl.redis.RedisCacheManager
;cacheManager_redis.mode=kv
;cacheManager = org.nutz.plugins.cache.impl.lcache.LCacheManager
;cacheManager.level1 = $cacheManager_ehcache
;cacheManager.level2 = $cacheManager_redis
;-------------Redis作为shiro二级缓存时启用这里---------
3、当然你还需要正确配置redis信息,src/main/resources/custom/redis.properties
redis.host=localhost
redis.port=6379
redis.timeout=2000
#redis.password=wizzer
#redis集群模式设置 redis.mode=cluster
redis.mode=normal