【发布时间】:2014-11-09 04:59:23
【问题描述】:
我试图使 arr 成为每个用户都拥有但从未发送到客户端的数组。一天前,它停止在用户创建时被放入用户对象中。这是代码;谢谢。
客户
Template.create_user.events({
'click #create-user-button': function() {
var username = $("#username").val();
var password = $("#password").val();
var email = $("#email").val();
var bio = $("#bio").val() || "";
if (!username || !password || !email) {
} else {
Accounts.createUser({
username: username,
password: password,
email: email,
arr:[],
profile: {
bio: bio
}
});
}
}
});
服务器/user.js
Accounts.onCreateUser(function(options, user) {
if (options.profile)
user.profile = options.profile;
return user;
});
【问题讨论】: