标签:ali 匿名访问 val manager new ring tor 资源 安全
@Bean(name="shiroFilter") public ShiroFilterFactoryBean shiroFilter(@Qualifier("securityManager") SecurityManager manager) { //安全事务管理器工厂类 ShiroFilterFactoryBean bean=new ShiroFilterFactoryBean(); bean.setSecurityManager(manager); //配置未登录时拦截到的路径 bean.setLoginUrl("/user/notlogin"); //配置访问权限 LinkedHashMap<String, String> filterChainDefinitionMap=new LinkedHashMap<>(); filterChainDefinitionMap.put("/user/validateCode","anon");//匿名访问验证码 filterChainDefinitionMap.put("/user/insert", "anon");//匿名注册 filterChainDefinitionMap.put("/index", "anon"); //匿名跳转 filterChainDefinitionMap.put("/user/login", "anon"); //匿名登录 filterChainDefinitionMap.put("/u/**", "anon"); //匿名登录 filterChainDefinitionMap.put("/static/*", "anon"); //匿名访问静态资源 filterChainDefinitionMap.put("/*", "authc");//表示需要认证才可以访问 filterChainDefinitionMap.put("/**", "authc");//表示需要认证才可以访问 filterChainDefinitionMap.put("/*.*", "authc"); bean.setFilterChainDefinitionMap(filterChainDefinitionMap); return bean; }
标签:ali 匿名访问 val manager new ring tor 资源 安全
原文地址:https://www.cnblogs.com/cbhs/p/9495582.html