Shiro实现的主要原理如图:
使用Spring-boot集成Shiro安全框架主要步骤:
1.建立一个Spring-boot的项目集成Mybatis-plus 和 shiro框架。
2.导入相关依赖。
下面是最主要的shiro依赖!!!!!其他依赖根据项目来导入:eg:spring-web,lombok。
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring-boot-web-starter</artifactId>
<version>1.4.1</version>
</dependency>
核心步骤:
3.修改配置类:xxx.config
@Bean public ShiroFilterChainDefinition shiroFilterChainDefinition(){ DefaultShiroFilterChainDefinition sfcd = new DefaultShiroFilterChainDefinition(); //定义某个路径 使用 哪个过滤器来处理 //警告:过滤器定义有顺序 s