0

如何确定启动我在服务器方法单元中创建的功能之一的用户?

4

2 回答 2

1

在 ServerContainerUnit 或 WebModuleUnit (ISAPI) 中,


DSAuthenticationManager.onUserAuthenticate 过程或 TDSServer.onConnect 等...,


使用 TDSSessionManager.GetThreadSession.PutData(' UserName ',User); 识别 DSSession 的当前用户,


在您的 Servermethods 单元函数中,您可以使用来自 DSSession 的 TDSSessionManager.GetThreadSession.GetData(' UserName ') 保存在 UserAuthenticate 或其他过程中的内容。


在 DataSnap REST ISAPI 上测试,工作正常。

于 2013-10-17T17:13:39.193 回答
0

TDSSessionManager.GetThreadSession.Username如果您启用了身份验证,请使用。

于 2016-09-22T05:33:52.340 回答