为什么 Google 的 API 响应对象的 属性 键是随机的双字符字符串?
Why are Google's API response objects' property keys random two-character strings?
所以我刚开始使用 Google 的 Gplus API 来开发我正在开发的应用程序并且一切正常,但我真的很困惑 Google' s 响应对象的 属性 键似乎具有完全随机的双字符字符串。例如,这是我得到的:
WE {El: "100327378902537923764", Ka: Object, wc: PG}
El: "100327378902537923764"
Ka: Object
wc: PG
Ka: "100327378902537923764"
Ld: "Thomas Moore"
wc: "example@gmail.com"
zt: "https://lh6.googleusercontent.com/-example/AAAAAAAAAAI/AAAAAAAAMPA/Vo75ASRTN_k/s96-c/photo.jpg"
我正在使用 JavaScript SDK 和 Angular。很好奇有没有人对此有合理的解释
编辑:这是我提出的要求:
gapi.auth2.getAuthInstance().then(function (googleAuth) {
googleAuth.signIn({ 'scope': 'profile email' }).then(function (result) {}
Google 通过方便的 getter 方法公开这些属性。例如,要获取配置文件信息,您可以使用以下 gapi.oauth2.BasicProfile
对象的 getter:
// profile id
gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getId();
// profile name
gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getName();
所以我刚开始使用 Google 的 Gplus API 来开发我正在开发的应用程序并且一切正常,但我真的很困惑 Google' s 响应对象的 属性 键似乎具有完全随机的双字符字符串。例如,这是我得到的:
WE {El: "100327378902537923764", Ka: Object, wc: PG}
El: "100327378902537923764"
Ka: Object
wc: PG
Ka: "100327378902537923764"
Ld: "Thomas Moore"
wc: "example@gmail.com"
zt: "https://lh6.googleusercontent.com/-example/AAAAAAAAAAI/AAAAAAAAMPA/Vo75ASRTN_k/s96-c/photo.jpg"
我正在使用 JavaScript SDK 和 Angular。很好奇有没有人对此有合理的解释
编辑:这是我提出的要求:
gapi.auth2.getAuthInstance().then(function (googleAuth) {
googleAuth.signIn({ 'scope': 'profile email' }).then(function (result) {}
Google 通过方便的 getter 方法公开这些属性。例如,要获取配置文件信息,您可以使用以下 gapi.oauth2.BasicProfile
对象的 getter:
// profile id
gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getId();
// profile name
gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getName();