2014-09-03 60 views

回答

1

方法Accounts.createUser(包帳戶密碼)引擎蓋方法Accounts.insertNewDoc(options, user)其是從包accounts-base服務器側方法下使用。

您可以創建自己的方法:

Meteor.methods({ 
    "customCreateUser":function(options,user){ 
    // returns userId 
    return Accounts.insertNewDoc(options, user) 
    } 
}) 

Accounts.insertNewDoc(options, user)沒有限制創建只有當emailusernameoptions傳遞用戶。

但是這種限制有Accounts.createUser

var username = options.username; 
    var email = options.email; 
    if (!username && !email) 
    throw new Meteor.Error(400, "Need to set a username or email"); 

line 671-674

+0

怎麼樣用一個自定義字段登錄:說我有'富:「bla'',如果用戶輸入'富之價值「他正確登錄了。有可能嗎? – ilyo 2014-09-03 11:25:23

+0

對於這個問題,我沒有答案,需要挖掘到'accounts'包。請創建新的問題,然後我試圖找出答案。 – 2014-09-03 11:27:13

+0

thanx http://stackoverflow.com/questions/25643187/ – ilyo 2014-09-03 11:31:57

相關問題