gpt4 book ai didi

javascript - 如何使用 hello.js 获取用户电子邮件 ID?

转载 作者:行者123 更新时间:2023-11-30 16:24:08 25 4
gpt4 key购买 nike

我正在尝试使用 hello.js 登录网站。 我获得了用户名,但无法获得用户电子邮件 ID。我怎样才能得到这个?

我正在关注 this link .

这是我的代码:

<script src="hello.js" ></script>

<script>

hello.init({
google: "742850147964-r4pfusmgmp2mtfbngh387e30k3692p79.apps.googleusercontent.com"
}, {redirect_uri: 'index.php'});

hello.on('auth.login', function(auth) {

// Call user information, for the given network
hello(auth.network).api('/me').then(function(r) {
console.log("r.email = "+r.email);
console.log("r.name== = "+r.name);
});
});
</script>

最佳答案

我通过简单更改 hello.js 解决了我的问题。

对于谷歌:-

scope: {                
basic: 'https://www.googleapis.com/auth/plus.me profile',
}

scope: {                
basic: 'https://www.googleapis.com/auth/userinfo.email',
}

Facebook :-

scope: {                
basic: 'public_profile',
}

scope: {                
basic: 'public_profile,email',
}

关于javascript - 如何使用 hello.js 获取用户电子邮件 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34348614/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com