李宇
2021-01-15 61de83f769642ff7da3d7f32b39c5014167a2950
src/main/webapp/WEB-INF/spring-shiro.xml
@@ -60,7 +60,14 @@
    </bean>
    <!-- Cache Manager -->
    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager"></bean>
    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
        <property name="cacheManager" ref="ehcacheManager"/>
    </bean>
    <!-- 如果有多个ehcacheManager要在bean加上p:shared="true" -->
    <bean id="ehcacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
        <property name="configLocation" value="WEB-INF/ehcache.xml"/>
    </bean>
    <!--session manager-->
    <bean id="sessionManager"
@@ -77,6 +84,13 @@
    <!--自定义 Realm-->
    <bean id="authorizationRealm" class="com.nanometer.smartlab.realm.AuthorizationRealm">
        <property name="credentialsMatcher" ref="md5Matcher"/>
        <!-- 启用身份验证缓存,即缓存AuthenticationInfo信息,默认false -->
        <property name="authenticationCachingEnabled" value="true"/>
        <!-- 缓存AuthenticationInfo信息的缓存名称 -->
        <property name="authenticationCacheName" value="authenticationCache"/>
        <!-- 缓存AuthorizationInfo信息的缓存名称 -->
        <property name="authorizationCacheName" value="authorizationCache"/>
    </bean>
    <!-- Security Manager -->
@@ -95,4 +109,4 @@
        <property name="securityManager" ref="securityManager"/>
    </bean>
</beans>
</beans>