返回列表 发布新帖

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

84 1
发表于 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"); ...

评论1

admin楼主Lv.9 发表于 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");
大家来答
    热门讨论
      精选文章
      数据驱动2.0工作流流程变量说明
      在工作流执行的过程中,我们常常需要先取得一些待处理的数据,并在处理后将结果存放起
      互联中台整合请求安全码(digi-key)说明
      互联中台整合请求中有安全码的设计,用来验证整合请求的合法性。安全码的位置说明如下
      数据比对介绍
       一、数据比对介绍(一)业务场景在项目实施中,预算执行率的准确计算依赖于敏态
      Athena 五大驱动力介绍
                    在数字化转型的浪
      开发不踩雷-数据驱动2.0, 模型栏位异动调整时的注意事项
      场景说明我们在应用开发过程中, 模型的异动是非常常见的一般情况的开发顺序为 模型设
      • 关注公众号
      Copyright © 2025 鼎捷数智股份有限公司 版权所有 All Rights Reserved. Powered by Discuz! X5.0
      关灯 在本版发帖
      即将开放
      返回顶部
      快速回复 返回顶部 返回列表