返回列表 發布新帖

評論1

姜文盛樓主Lv.9 發表於 2025-3-13 15:43 | 查看全部
租戶及使用者資訊可以在服務上下文中取得。 請參考以下代碼範例:
- 取出服務上下文
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”);

回復

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

  • 加入Line諮詢
Copyright © 2026 鼎新數智股份有限公司 版權所有 All Rights Reserved. Powered by Discuz! X5.0
關燈 在本版發帖
即将开放
返回頂部
快速回復 返回頂部 返回列表