Shiro解除拦截路径无效

Shiro解除拦截路径无效

写了一个接口,在shiroConfig中配置了aoon解除url拦截但是还是被拦截到了,也没仔细看,经人提醒忽然看到上面配置了

        map.put("/**", "authc");
        

然后下面又配置了接口解除拦截,

  		map.put("/student/save","anon");
        map.put("/student/update","anon");
        map.put("/student/delete","anon");

猜想可能是由于拦截顺序的问题,导致先做了拦截,又设置导致了解除无效 更改顺序即可

		map.put("/student/save","anon");
        map.put("/student/update","anon");
        map.put("/student/delete","anon");
 		 map.put("/**", "authc");

shiro的map要使用linkdhashMap

        LinkedHashMap<String, String> map= new LinkedHashMap<>();


版权声明:本文为weixin_47314019原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。