如何将数据保存到 Parse.com 中的用户会话
How to save data to user session in Parse.com
我在后端登录用户后(我使用 Parse.com CloudCode)我想在他的会话中将 uri 保存到他的头像。
我将如何在 Parse.com 中做到这一点。我知道有一个对象 Parse.Session.current() 但不确定如何使用它。
像 parse 提供的其他对象一样对待它。
Parse.Session.current().then(function(session) {
session.set("foo", "bar");
session.save().then(function() {
console.log(session.get("foo"));
});
});
会话 CLP 应设置为允许此操作。 (并且应用程序必须设置为需要可撤销会话)。
我在后端登录用户后(我使用 Parse.com CloudCode)我想在他的会话中将 uri 保存到他的头像。 我将如何在 Parse.com 中做到这一点。我知道有一个对象 Parse.Session.current() 但不确定如何使用它。
像 parse 提供的其他对象一样对待它。
Parse.Session.current().then(function(session) {
session.set("foo", "bar");
session.save().then(function() {
console.log(session.get("foo"));
});
});
会话 CLP 应设置为允许此操作。 (并且应用程序必须设置为需要可撤销会话)。