简体   繁体   English

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

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

I want to get the customerid to do some custom code in volusion.我想让 customerid 在 volusion 中做一些自定义代码。 Please help me if there is any way so that I can fetch the customerid.如果有任何方法可以获取客户 ID,请帮助我。 I can see in cookie there is a cookie named "CustomerID" but I am unable to decrypt it .我可以在 cookie 中看到一个名为“CustomerID”的 cookie,但我无法解密它。

I put this in the jquery .ready() function...我把它放在 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); } });

You can use the Volusion frontend API:您可以使用 Volusion 前端 API:

www.yoursite.com /api/v1/users www.yoursite.com /api/v1/users

This endpoint will return the logged in user as a JSON.此端点将登录用户作为 JSON 返回。

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

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