框架调整
This commit is contained in:
parent
b62dba7be0
commit
e6d5a0ed1d
@ -16,10 +16,11 @@ import java.util.TimeZone;
|
|||||||
public class EbikeTenantFactory implements TenantFactory {
|
public class EbikeTenantFactory implements TenantFactory {
|
||||||
|
|
||||||
public Object[] getTenantIds() {
|
public Object[] getTenantIds() {
|
||||||
|
try {
|
||||||
if (StpUtil.isLogin()) {
|
if (StpUtil.isLogin()) {
|
||||||
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
||||||
|
if (attributes != null) {
|
||||||
Object attribute = attributes.getAttribute("tenantId", RequestAttributes.SCOPE_REQUEST);
|
Object attribute = attributes.getAttribute("tenantId", RequestAttributes.SCOPE_REQUEST);
|
||||||
if (attribute != null) {
|
|
||||||
String id = (String) StpUtil.getLoginId();
|
String id = (String) StpUtil.getLoginId();
|
||||||
Object object = StpUtil.getSessionByLoginId(id).get(id);
|
Object object = StpUtil.getSessionByLoginId(id).get(id);
|
||||||
ObjectMapper objectMapper = new ObjectMapper()
|
ObjectMapper objectMapper = new ObjectMapper()
|
||||||
@ -35,7 +36,10 @@ public class EbikeTenantFactory implements TenantFactory {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long tenantId = Long.parseLong(attribute.toString());
|
long tenantId = 0;
|
||||||
|
if (attribute != null) {
|
||||||
|
tenantId = Long.parseLong(attribute.toString());
|
||||||
|
}
|
||||||
//系统管理员
|
//系统管理员
|
||||||
if (isSysAdmin) {
|
if (isSysAdmin) {
|
||||||
return null;
|
return null;
|
||||||
@ -46,5 +50,9 @@ public class EbikeTenantFactory implements TenantFactory {
|
|||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user