話說:在項目後期,集成本應該最簡單的緩存功能,沒想到在單元測試時發現有些servers可以使用緩存,有些不行,換了ehcache2 和ehcache3都出問題,最後一步步集成,才發現是shiro的問題,巨坑~~~
不能在登錄認證中使用xxxServers,否則該servers用不了cache
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token){
此間不能使用servers,用dao
}
授權部分倒是可以
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals){
此間可以有
}