02 2018 档案

摘要:一、 怎么用 Shiro 支持三种方式的授权 编程式:通过写 if/else 授权代码块完成: Subject subject = SecurityUtils.getSubject(); if(subject.hasRole(“admin”)) { //有权限 } else { //无权限 } 注解 阅读全文
posted @ 2018-02-25 09:39 Lucare 阅读(821) 评论(0) 推荐(0)
摘要:在springMVC中要使用shiro,一般都遵循下面的配置: applicationContext-shiro.xml <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <prope 阅读全文
posted @ 2018-02-08 09:44 Lucare 阅读(389) 评论(0) 推荐(0)
摘要:登录操作一般都是我们触发的: Subject subject = SecurityUtils.getSubject(); AuthenticationToken authenticationToken = new ... subject.login(authenticationToken); Sub 阅读全文
posted @ 2018-02-07 20:22 Lucare 阅读(1447) 评论(0) 推荐(0)