我尝试使用 Syncano 用户管理系统为我的应用程序实现用户注册。我能够使用以下 JS 库代码成功创建新用户:
var sync = new Syncano({ apiKey: 'API_KEY', instance: 'INSTANCE' });
sync.user().add(signUp).then(function(res){
console.log(res);
}).catch(function(err) {
console.log(err);
});
然后我尝试按照此处找到的代码向我的用户添加配置文件字段:https ://www.syncano.io/user-management-for-your-apps/#adding-fields
var sync = new Syncano({ apiKey: 'API_KEY', instance: 'INSTANCE' });
sync.user().add(signUp).then(function(res){
var instance = new Syncano({
apiKey: API_KEY,
instance: INSTANCE_NAME,
userKey: res.user_key
});
instance.class('user_profile').dataobject(res.id).update({firstName: 'First', lastName: 'Last'});
}).catch(function(err) {
console.log(err);
});
当我在第一个的 .then() 语句中进行第二个 API 调用时,我收到此错误:
“api.syncano.io/v1/instances/INSTANCE/classes/user_profile/objects/26/:1 补丁 https://api.syncano.io/v1/instances/INSTANCE/classes/user_profile/objects/26/ 404 (未找到)user.service.js:77 错误:{"detail":"未找到"}"
有任何想法吗?