添加依赖
<!--thymeleaf整合shiro-->
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
在ShiroConfig中添加如下代码
/**
* 配置ShiroDialect,用于thymeleaf和shiro便签配合使用
* @return
*/
@Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}
shiro标签的用法自行百度。