1

我正在使用代码从谷歌导入联系人列表。一切都很好,但无法从中获得任何结果。

fetchmail()方法返回:ERROR {}

这是我的 fetchmail() 方法:

fetchmail() {
console.log("check6");
gapi.load('client: auth2', () => {
  console.log('check7');
  gapi.auth2.getAuthInstance({
    apiKey: 'APIKEY',
    discoveryDocs: ['https://people.googleapis.com/$discovery/rest?version=v1'],
    clientId: '<MyClientID>.apps.googleusercontent.com',
    scope: 'profile email https://www.googleapis.com/auth/contacts.readonly'
  }).then(() => {
    console.log('check8');
    return gapi.client.people.people.connections.list({
      resourceName: 'people/me',
      personFields: 'emailAddresses, names'
    });
  }).then(
    (res) => {
      console.log("Res: " + JSON.stringify(res));
      this.userContacts.emit(this.transformToMailListModel(res.result));
      console.log("Res:" + JSON.stringify(res.result));
    },
    error => console.log("ERROR " + JSON.stringify(error))
  );
});

从浏览器控制台我得到这个结果:

在此处输入图像描述

任何人都可以帮我找到问题或提出解决方案。

提前致谢!

4

0 回答 0