ApplicationContext-shiro.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans.xsd
  9. http://www.springframework.org/schema/aop
  10. http://www.springframework.org/schema/aop/spring-aop.xsd
  11. http://www.springframework.org/schema/context
  12. http://www.springframework.org/schema/context/spring-context.xsd
  13. http://www.springframework.org/schema/tx
  14. http://www.springframework.org/schema/tx/spring-tx.xsd
  15. ">
  16. <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
  17. <property name="realm" ref="ShiroRealm" />
  18. </bean>
  19. <!-- 項目自定义的Realm -->
  20. <bean id="ShiroRealm" class="com.zhcs.dt.interceptor.shiro.ShiroRealm" ></bean>
  21. <!-- Shiro Filter -->
  22. <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
  23. <property name="securityManager" ref="securityManager" />
  24. <property name="loginUrl" value="/" />
  25. <property name="successUrl" value="/main/index" />
  26. <property name="unauthorizedUrl" value="/login_toLogin" />
  27. <property name="filterChainDefinitions">
  28. <value>
  29. /api = anon
  30. /SynchCompany = anon
  31. /SynchRoad = anon
  32. /SynchStake = anon
  33. /static/login/** = anon
  34. /plugins/keypad/** = anon
  35. /static/js/myjs/** = authc
  36. /static/js/** = anon
  37. /uploadFiles/uploadImgs/** = anon
  38. /code.do = anon
  39. /login_login = anon
  40. /login_point = anon
  41. /app**/** = anon
  42. /weixin/** = anon
  43. /** = authc
  44. </value>
  45. </property>
  46. </bean>
  47. </beans>