一、Spring Boot框架集成shiro
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.spring.version}</version>
</dependency>
2.shiro目录
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/45d741ba52c4c4d33af02ff1ecdabdbf.png)
3.shiroConfig(shiro的主要配置文件)
/**
* @author ***
* @date Dec. 31, 2019
* @description ShiroConfig
*/
@Configuration
public class ShiroConfig {
/**
* 开启aop注解支持
*
* @return AuthorizationAttributeSourceAdvisor
*/
@Bean
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
authorizationAttributeSourceAdvisor.setSecurityManager(securityManager);
return authorizationAttributeSourceAdvisor;
}
@Bean(name = "shiroFilter")
public ShiroFilterFactoryBean shiroFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
shiroFilterFactoryBean.setSecurityManager(securityManager);
Map<St