springboot 中在ftl页面上使用shiro标签

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014514528/article/details/80255375

1.首先第一步导入依赖

<dependency>
    <groupId>com.github.theborakompanioni</groupId>
    <artifactId>thymeleaf-extras-shiro</artifactId>
    <version>1.2.1</version> 
</dependency>

2.ftl页面中引入命名空间

<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

3.ftl页面中使用标签    

 <@shiro.hasRole name="merchants">
	                    	<div>
		                       我有这个角色哦!
	                    	</div>
 </@shiro.hasRole> 

猜你喜欢

转载自blog.csdn.net/u014514528/article/details/80255375