|  |  |  | 
|---|
|  |  |  | import org.apache.shiro.session.mgt.SessionManager; | 
|---|
|  |  |  | import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; | 
|---|
|  |  |  | import org.apache.shiro.spring.web.ShiroFilterFactoryBean; | 
|---|
|  |  |  | import org.apache.shiro.util.ThreadContext; | 
|---|
|  |  |  | import org.apache.shiro.web.mgt.DefaultWebSecurityManager; | 
|---|
|  |  |  | import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Bean | 
|---|
|  |  |  | public SecurityManager securityManager() { | 
|---|
|  |  |  | DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); | 
|---|
|  |  |  | ThreadContext.bind(securityManager);//加上这句代码手动绑定 | 
|---|
|  |  |  | securityManager.setRealm(shiroRealm); | 
|---|
|  |  |  | securityManager.setSessionManager(this.sessionManager()); | 
|---|
|  |  |  | securityManager.setCacheManager(shiroCacheManager); | 
|---|
|  |  |  | 
|---|
|  |  |  | map.put("/system/logout", "anon"); | 
|---|
|  |  |  | map.put("/common/captcha", "anon"); | 
|---|
|  |  |  | map.put("/statistics/**", "anon"); | 
|---|
|  |  |  | map.put("/business/hksync/push/**", "anon"); | 
|---|
|  |  |  | map.put("/dingding/push", "anon"); | 
|---|
|  |  |  | //        map.put("/ext/workorderExt/freshStatistics", "anon"); | 
|---|
|  |  |  | map.put("/dingding/jsapiTicket", "anon"); | 
|---|