在springboot2.0中需要注意一个问题,那就是shiro和thymeleaf的支持依赖需要使用2.0.0
1、添加依赖
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
2、在ShiroConfig中配置ShiroDialect
/**
* shiro方言 支持shiro标签
* @return
*/
@Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}