我在我的网站上添加了一个“使用谷歌登录”按钮,它登录成功(我知道这是因为按钮切换到“登录”),但我没有从谷歌帐户中获取数据我需要继续,控制台完全没有显示。这是代码:
<head>
<meta name="google-signin-client_id" content ="******************************************.apps.googleusercontent.com">
</head>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<script>
function onSignIn(googleUser) {
var profile = googleUser.getBasicProfile();
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail());
}
</script>
<footer>
<script src="https://apis.google.com/js/platform.js" async defer></script>
</footer>
我正在使用 php 编码