[英]How to get the ID of the user who is logged into the current session?
I need to find the user who is logged into the current session. 我需要找到登录当前会话的用户。 I tried the following but does not work: Can anyone help me? 我尝试了以下但不起作用:任何人都可以帮助我吗? Thanks in advance! 提前致谢!
$.get(CurrentServerAddress + '/service/v4/rest.php', {
method: "get_user_id",
input_type: "JSON",
response_type: "JSON",
rest_data:'"new_get_user_id":["session":"' + SugarSessionId + '"]'
}, function(data) {
if (data !== undefined) {
var userID = jQuery.parseJSON(data);
}
});
I tried the following and it works for me. 我尝试了以下内容,它适用于我。
var userID = '';
$.get(CurrentServerAddress + '/service/v4/rest.php', {
method: "get_user_id",
input_type: "JSON",
response_type: "JSON",
rest_data: '[{"session":"' + SugarSessionId + '"}]'
}, function(data) {
if (data !== undefined) {
userID = jQuery.parseJSON(data);
}
});
'authenticated_user_id'
据我所知,这是你应该寻找的会议中的糖crm项目,你要求吗?
The REST call that you are making requires that you have a SESSION token. 您正在进行的REST调用要求您拥有SESSION令牌。 Normally, we will setup a REST user on our CRM's that can be accessed via REST. 通常,我们将在我们的CRM上设置一个REST用户,可以通过REST访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.