在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();
}
3、html中导入shiro标签
转载请务必保留此出处(原作者):https://blog.csdn.net/zhuzhezhuzhe1
版权声明:本文为原创文章,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。
https://blog.csdn.net/zhuzhezhuzhe1