本文整理匯總了TypeScript中meteor/accounts-base.Accounts.createUserWithPhone方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Accounts.createUserWithPhone方法的具體用法?TypeScript Accounts.createUserWithPhone怎麽用?TypeScript Accounts.createUserWithPhone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類meteor/accounts-base.Accounts
的用法示例。
在下文中一共展示了Accounts.createUserWithPhone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: importPictureFromUrl
Meteor.startup(() => {
if (Meteor.settings) {
Object.assign(Accounts._options, Meteor.settings['accounts-phone']);
SMS.twilio = Meteor.settings['twilio'];
}
// Configuring oAuth services
const services = Meteor.settings.private.oAuth;
if (services) {
for (let service in services) {
ServiceConfiguration.configurations.upsert({service: service}, {
$set: services[service]
});
}
}
if (Users.collection.find().count() > 0) {
return;
}
let picture = importPictureFromUrl({
name: 'man1.jpg',
url: 'https://randomuser.me/api/portraits/men/1.jpg'
});
Accounts.createUserWithPhone({
phone: '+972540000001',
profile: {
name: 'Ethan Gonzalez',
pictureId: picture._id
}
});
picture = importPictureFromUrl({
name: 'lego1.jpg',
url: 'https://randomuser.me/api/portraits/lego/1.jpg'
});
Accounts.createUserWithPhone({
phone: '+972540000002',
profile: {
name: 'Bryan Wallace',
pictureId: picture._id
}
});
picture = importPictureFromUrl({
name: 'woman1.jpg',
url: 'https://randomuser.me/api/portraits/women/1.jpg'
});
Accounts.createUserWithPhone({
phone: '+972540000003',
profile: {
name: 'Avery Stewart',
pictureId: picture._id
}
});
picture = importPictureFromUrl({
name: 'woman2.jpg',
url: 'https://randomuser.me/api/portraits/women/2.jpg'
});
Accounts.createUserWithPhone({
phone: '+972540000004',
profile: {
name: 'Katie Peterson',
pictureId: picture._id
}
});
picture = importPictureFromUrl({
name: 'man2.jpg',
url: 'https://randomuser.me/api/portraits/men/2.jpg'
});
Accounts.createUserWithPhone({
phone: '+972540000005',
profile: {
name: 'Ray Edwards',
pictureId: picture._id
}
});
});
示例2:
}].forEach(user => {
Accounts.createUserWithPhone(user);
});