|  |  |  | 
|---|
|  |  |  | package com.doumee.config.shiro; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import org.apache.shiro.mgt.SecurityManager; | 
|---|
|  |  |  | import org.apache.shiro.session.mgt.SessionManager; | 
|---|
|  |  |  | import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; | 
|---|
|  |  |  | 
|---|
|  |  |  | DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); | 
|---|
|  |  |  | securityManager.setRealm(shiroRealm); | 
|---|
|  |  |  | securityManager.setSessionManager(this.sessionManager()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | securityManager.setCacheManager(shiroCacheManager); | 
|---|
|  |  |  | return securityManager; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) { | 
|---|
|  |  |  | ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); | 
|---|
|  |  |  | shiroFilterFactoryBean.setSecurityManager(securityManager); | 
|---|
|  |  |  | Map<String, String> map = new HashMap<>(); | 
|---|
|  |  |  | Map<String, String> map = new LinkedHashMap<>(); | 
|---|
|  |  |  | // 路径拦截配置 | 
|---|
|  |  |  | map.put("/system/login", "anon"); | 
|---|
|  |  |  | map.put("/system/logout", "anon"); | 
|---|
|  |  |  | map.put("/common/captcha", "anon"); | 
|---|
|  |  |  | //文件上传取消拦截 | 
|---|
|  |  |  | map.put("/public/**", "anon"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | map.put(Constants.CLOUD_SERVICE_URL_INDEX+"/**", "anon"); | 
|---|
|  |  |  | // - 放行swagger | 
|---|
|  |  |  | map.put("/doc.html", "anon"); | 
|---|
|  |  |  | map.put("/webjars/**", "anon"); | 
|---|
|  |  |  | map.put("/swagger-resources/**", "anon"); | 
|---|
|  |  |  | map.put("/v2/api-docs/**", "anon"); | 
|---|
|  |  |  | map.put("/swagger-ui/**", "anon"); | 
|---|
|  |  |  | map.put("/wgListener/**", "anon"); | 
|---|
|  |  |  | // - 其他接口统一拦截 | 
|---|
|  |  |  | map.put("/**", "authc"); | 
|---|