| package doumeemes.config.shiro; | 
|   | 
| import doumeemes.core.model.LoginUserInfo; | 
| import doumeemes.core.utils.Constants; | 
| import doumeemes.dao.business.model.Department; | 
| import doumeemes.dao.ext.dto.QueryCompanyUserExtDTO; | 
| import doumeemes.dao.ext.vo.CompanyUserExtListVO; | 
| import doumeemes.dao.system.model.SystemPermission; | 
| import doumeemes.dao.system.model.SystemRole; | 
| import doumeemes.dao.system.model.SystemUser; | 
| import doumeemes.service.ext.CompanyUserExtService; | 
| import doumeemes.service.system.SystemPermissionService; | 
| import doumeemes.service.system.SystemRoleService; | 
| import doumeemes.service.system.SystemUserService; | 
| import org.apache.shiro.authc.*; | 
| import org.apache.shiro.authz.AuthorizationInfo; | 
| import org.apache.shiro.authz.SimpleAuthorizationInfo; | 
| import org.apache.shiro.realm.AuthorizingRealm; | 
| import org.apache.shiro.subject.PrincipalCollection; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.context.annotation.Lazy; | 
| import org.springframework.stereotype.Component; | 
|   | 
| import java.util.List; | 
|   | 
| /** | 
|  * 自定义Token ,处理认证和权限 | 
|  * @author Eva.Caesar Liu | 
|  * @date 2022/04/18 18:12 | 
|  */ | 
| @Component | 
| public class ShiroToken extends UsernamePasswordToken { | 
|   | 
|     /** | 
|      * 公司ID | 
|      */ | 
|     Integer companyId; | 
|     Boolean isDdLogin; | 
|     Boolean isWxLogin; | 
|   | 
|     public ShiroToken() { | 
|     } | 
|     public  ShiroToken(Integer companyId,String username, String password,boolean isDdLogin,boolean isWxLogin) { | 
|         super(username,  password, false, (String)null); | 
|         this.companyId = companyId; | 
|         this.isDdLogin = isDdLogin; | 
|         this.isWxLogin = isWxLogin; | 
|     } | 
|   | 
|     public Boolean getDdLogin() { | 
|         return isDdLogin; | 
|     } | 
|   | 
|     public void setDdLogin(Boolean ddLogin) { | 
|         isDdLogin = ddLogin; | 
|     } | 
|   | 
|   | 
|     public Boolean getWxLogin() { | 
|         return isWxLogin; | 
|     } | 
|   | 
|     public void setWxLogin(Boolean wxLogin) { | 
|         isWxLogin = wxLogin; | 
|     } | 
|   | 
|     public Integer getCompanyId() { | 
|         return companyId; | 
|     } | 
|   | 
|     public void setCompanyId(Integer companyId) { | 
|         this.companyId = companyId; | 
|     } | 
| } |