[英]Delphi: Datasnap Identifying User from Server Methods Unit
如何確定啟動在服務器方法單元中創建的功能之一的用戶?
在ServerContainerUnit或WebModuleUnit(ISAPI)中,
DSAuthenticationManager.onUserAuthenticate過程或TDSServer.onConnect等...,
使用TDSSessionManager.GetThreadSession.PutData(' UserName ',User); 確定DSSession的當前用戶,
在Servermethods單元函數中,可以從DSSession使用TDSSessionManager.GetThreadSession.GetData(' UserName ')在UserAuthenticate或其他過程中保存的內容。
經過DataSnap REST ISAPI的測試,工作正常。
如果啟用了身份驗證,則只需使用TDSSessionManager.GetThreadSession.Username
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.