admin 发表于 2024-12-27 23:30:00

微服务中如何取得用户资讯

微服务中如何取得用户资讯

admin 发表于 2024-12-27 23:30:00

租户及用户资讯可以在服务上下文中取得。请参考以下代码范例:
// 取出服务上下文
DWServiceContext context = DWServiceContext.getContext();
Map tProfile = DWServiceContext.getContext().getProfile();
// 取得租户SID
long tenantSid = (long) tProfile.get("tenantSid");
// 取得租户ID
String tenantId = (String) tProfile.get("tenantId");
// 取得租户名称
String tenantName = (String) tProfile.get("tenantName");
// 取得用户ID
String userId = (String) tProfile.get("userId");
// 取得租户名称
String userName = (String) tProfile.get("userName");
页: [1]
查看完整版本: 微服务中如何取得用户资讯