本文整理汇总了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);
});