shiro在thymeleaf中的常用标签

修改登录界面加入rememberMe复选框:
在login.html中加入:

记住我

在pom.xml中引入依赖

	
			com.github.theborakompanioni
			thymeleaf-extras-shiro
			2.0.0
		

ShiroConfiguration.java中添加

    /**
     * ShiroDialect,为了在thymeleaf里使用shiro的标签的bean
     * @return
     */
    @Bean
    public ShiroDialect shiroDialect(){
		return new ShiroDialect();
	}

index.html引入

 
  

shiro标签的简单描述

  

  
  
Insert title here  
  
  
    

index

Please login

Welcome back John! Not John? Click here to login.

Hello, , how are you today?

Update your contact information

Hello, , how are you today?

Please login in order to update your credit card information.

Administer the system

Sorry, you are not allowed to developer the system.

You are a developer and a admin.

You are a admin, vip, or developer.

添加用户

Sorry, you are not allowed to delete user accounts.

You can see or add users.

You can see or delete users.

转载:https://blog.csdn.net/u014695188/article/details/52356158

你可能感兴趣的:(springboot,shiro)