|  |  |  | 
|---|
|  |  |  | 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.apache.shiro.authc.UsernamePasswordToken; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 自定义Token ,处理认证和权限 | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | Integer companyId; | 
|---|
|  |  |  | Boolean isDdLogin; | 
|---|
|  |  |  | Boolean isWxLogin; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public ShiroToken() { | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public  ShiroToken(Integer companyId,String username, String password,boolean isDdLogin) { | 
|---|
|  |  |  | 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() { | 
|---|
|  |  |  | 
|---|
|  |  |  | isDdLogin = ddLogin; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Boolean getWxLogin() { | 
|---|
|  |  |  | return isWxLogin; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setWxLogin(Boolean wxLogin) { | 
|---|
|  |  |  | isWxLogin = wxLogin; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Integer getCompanyId() { | 
|---|
|  |  |  | return companyId; | 
|---|
|  |  |  | } | 
|---|