我正在尝试在我的网站上放置一个谷歌+登录按钮,但是当我尝试使用它登录时出现400错误。这就是我得到的全部。
400. That’s an error.
The requested URL was not found on this server. That’s all we know.the
我在<head>
中包含以下内容:
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="620096179377-ula3qjt2s01qqhberlqq470n16kccnh5.apps.googleusercontent.com">
以及我想要的按钮:
<div class="g-signin2" data-onsuccess="onSignIn"></div>
答案 0 :(得分:0)
此代码适用于您:
<html>
<head>
<title>Test Google Login</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="620096179377-ula3qjt2s01qqhberlqq470n16kccnh5.apps.googleusercontent.com">
<script>
function onSignIn(googleUser) {
console.log(googleUser);
}
</script>
</head>
<body>
<div class="g-signin2"
data-onsuccess="onSignIn"></div>
</body>
</html>
如果问题仍然存在,您是否可以附上导致400的请求的详细信息? (网址应该足够了)