當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Accounts.createUserWithPhone方法代碼示例

本文整理匯總了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
    }
  });
});
開發者ID:DAB0mB,項目名稱:ionic2-meteor-messenger,代碼行數:86,代碼來源:main.ts

示例2:

 }].forEach(user => {
   Accounts.createUserWithPhone(user);
 });
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:3,代碼來源:main.ts


注:本文中的meteor/accounts-base.Accounts.createUserWithPhone方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。