【已解决】shiro整合springboot静态资源被拦截,无法访问

在shiro整合springboot如果使用了这个规则,那么static下的静态资源也会被拦截:filterMap.put("/**", "perms[user:root]");
那么怎么解决呢?
先上我的static的目录结构:
在这里插入图片描述
接下来需要放行这些资源,怎么做呢?

filterMap.put("/bootstrap/**","anon");
filterMap.put("/markdown/**","anon");
filterMap.put("/MyStyle/**","anon");
filterMap.put("/**", "perms[user:root]");

添加如上过滤规则即可!
意为:bootstrap/markdown/MyStyle 下的所有资源均设置为anon:无需认证(登录)就可以访问!

猜你喜欢

转载自blog.csdn.net/Pzzzz_wwy/article/details/106375943
今日推荐