html页面支持shiro标签
html页面支持shiro标签
只需修改3处地方
1. 添加依赖
<!-- html页面支持shiro标签 -->
<dependency>
<groupId>com.github.theborakompanioni</groupId>
<artifactId>thymeleaf-extras-shiro</artifactId>
<version>2.0.0</version>
</dependency>
2. ShiroConfig 添加 Bean
@Bean
public ShiroDialect shiroDialect() {
return new ShiroDialect();
}
3. HTML 文件引用
<html xmlns:th="http://www.thymeleaf.org"
xmlns:shiro="http://www.w3.org/1999/xhtml">