繁体   English   中英

在volusion平台中,如果用户已登录,如何获取客户ID

[英]How to get the customer id if user is logged in , in volusion platform

我想让 customerid 在 volusion 中做一些自定义代码。 如果有任何方法可以获取客户 ID,请帮助我。 我可以在 cookie 中看到一个名为“CustomerID”的 cookie,但我无法解密它。

我把它放在 jquery .ready() 函数中......

 $.ajax({ url: "/api/v1/users/current", dataType: "json", success: function (json) { firstName = json.data.firstName; lastName = json.data.lastName; email = json.data.email; id = json.data.id; alert (firstName + " " + lastName + " " + email + " " + id + " ") ; //return true; }, error: function(e){ //alert('error '+e.responseText); } });

您可以使用 Volusion 前端 API:

www.yoursite.com /api/v1/users

此端点将登录用户作为 JSON 返回。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM