租户改为从header获取
This commit is contained in:
parent
c4092229f6
commit
cdc8a819df
|
|
@ -196,8 +196,15 @@ public class CommonServiceImpl {
|
||||||
if(StringUtils.isNotBlank(authId)){
|
if(StringUtils.isNotBlank(authId)){
|
||||||
tenantId = authId;
|
tenantId = authId;
|
||||||
}else{
|
}else{
|
||||||
tenantId = CommonConstants.defaultTenant;
|
//个别controller中直接用了此方法
|
||||||
|
String hearderTenantId = HttpServletRequestUtil.getRequestInfo(CommonConstants.HEADER_TENANT_ID);
|
||||||
|
if(StringUtils.isNotBlank(hearderTenantId)){
|
||||||
|
tenantId =hearderTenantId;
|
||||||
|
}else{
|
||||||
|
tenantId = CommonConstants.defaultTenant;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
log.warn("当前租户1=============="+tenantId);
|
||||||
TenantContext.setTenant(tenantId);//设置当前租户
|
TenantContext.setTenant(tenantId);//设置当前租户
|
||||||
return tenantId;
|
return tenantId;
|
||||||
}
|
}
|
||||||
|
|
@ -209,6 +216,7 @@ public class CommonServiceImpl {
|
||||||
getTenantId(tenantId);
|
getTenantId(tenantId);
|
||||||
}else{
|
}else{
|
||||||
TenantContext.setTenant(CommonConstants.defaultTenant);//设置当前租户
|
TenantContext.setTenant(CommonConstants.defaultTenant);//设置当前租户
|
||||||
|
log.warn("当前租户2=============="+CommonConstants.defaultTenant);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue