| package com.doumee.config.shiro; | 
|   | 
| import org.apache.shiro.authc.UsernamePasswordToken; | 
|   | 
| /** | 
|  * 自定义Token ,处理认证和权限 | 
|  * @author Eva.Caesar Liu | 
|  * @date 2022/04/18 18:12 | 
|  */ | 
| //@Component | 
| public class ShiroToken extends UsernamePasswordToken { | 
|   | 
|     /** | 
|      * 公司ID | 
|      */ | 
|     boolean needPassword; | 
|     int userType; | 
|     Integer companyId; | 
|   | 
|     public ShiroToken() { | 
|     } | 
|     public  ShiroToken( String username, String password, boolean needPassword,int userType,Integer companyId) { | 
|         super(username,  password, false, (String)null); | 
|         this.needPassword = needPassword; | 
|         this.userType = userType; | 
|         this.companyId = companyId; | 
|     } | 
|     public Integer getCompanyId() { | 
|         return companyId; | 
|     } | 
|   | 
|     public void setCompanyId(Integer companyId) { | 
|         this.companyId = companyId; | 
|     } | 
|   | 
|   | 
|     public boolean isNeedPassword() { | 
|         return needPassword; | 
|     } | 
|   | 
|     public void setNeedPassword(boolean needPassword) { | 
|         this.needPassword = needPassword; | 
|     } | 
|   | 
|     public int getUserType() { | 
|         return userType; | 
|     } | 
|   | 
|     public void setUserType(int userType) { | 
|         this.userType = userType; | 
|     } | 
| } |