|
|
@@ -7,10 +7,8 @@ import java.util.Date; |
|
|
|
|
|
|
|
|
import com.iformall.domain.po.MallUserInfo; |
|
|
import com.iformall.domain.po.MallUserInfo; |
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
import com.iformall.enums.EnumGroupSupport; |
|
|
|
|
|
import com.iformall.shiro.UserSession; |
|
|
import com.iformall.shiro.UserSession; |
|
|
import com.iformall.utils.IPUtil; |
|
|
import com.iformall.utils.IPUtil; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
import org.apache.shiro.SecurityUtils; |
|
|
import org.apache.shiro.session.Session; |
|
|
import org.apache.shiro.session.Session; |
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
@@ -66,18 +64,13 @@ public class BaseController { |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public TenantEntity getTenantInfo(){ |
|
|
public TenantEntity getTenantInfo(){ |
|
|
TenantEntity tenantEntity = new TenantEntity(); |
|
|
|
|
|
Session session = SecurityUtils.getSubject().getSession(); |
|
|
Session session = SecurityUtils.getSubject().getSession(); |
|
|
Boolean isParent = (Boolean)session.getAttribute(UserSession.isParent); |
|
|
|
|
|
String tenantId = (String)session.getAttribute(UserSession.tenantId); |
|
|
String tenantId = (String)session.getAttribute(UserSession.tenantId); |
|
|
String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId); |
|
|
String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId); |
|
|
if(isParent!= null && isParent){ |
|
|
|
|
|
tenantEntity.setTenantId(null); |
|
|
|
|
|
tenantEntity.setParentTenantId(tenantId); |
|
|
|
|
|
}else{ |
|
|
|
|
|
tenantEntity.setTenantId(tenantId); |
|
|
|
|
|
tenantEntity.setParentTenantId(parentTenantId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
TenantEntity tenantEntity = new TenantEntity(){{ |
|
|
|
|
|
setTenantId(tenantId); |
|
|
|
|
|
setParentTenantId(parentTenantId); |
|
|
|
|
|
}}; |
|
|
return tenantEntity; |
|
|
return tenantEntity; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|