Commit cbdfa40e by libai

测试

parent b5f485c3
Showing with 14 additions and 26 deletions
......@@ -5,7 +5,7 @@ function loginGo(){
html+=' <div style="display: none;" class="login-box1">';
html+=' <div class="login-title">登入</div>';
html+=' <div class="phone-login-btn"></div>';
html+=' <div class="google-login-btn" id="g_id_onload"data-client_id="534183685500-ag0vai0jh6todldi4rg6lvp0gcsojk0n.apps.googleusercontent.com" data-callback="handleCredentialResponse"></div>';
html+=' <div class="google-login-btn" id="g_id_onload"data-client_id="YOUR_GOOGLE_CLIENT_ID" data-callback="handleCredentialResponse">></div>';
html+=' <div class="more-login"><img src="https://www.footseen.xyz/yazhaiTest/images/more-login.png" alt=""></div>';
html+=' <div class="more-login-box">';
html+=' <div class="more-login-icon"><img src="https://www.footseen.xyz/yazhaiTest/images/login-icon2.png" alt=""></div>';
......@@ -126,31 +126,19 @@ function loginGo(){
html+='</div>';
$(".login-content").html(html);
function handleCredentialResponse(response) {
// decodeJwtResponse() is a custom function defined by you
// to decode the credential response.
const responsePayload = decodeJwtResponse(response.credential);
console.log("ID: " + responsePayload.sub);
console.log('Full Name: ' + responsePayload.name);
console.log('Given Name: ' + responsePayload.given_name);
console.log('Family Name: ' + responsePayload.family_name);
console.log("Image URL: " + responsePayload.picture);
console.log("Email: " + responsePayload.email);
}
// function handleCredentialResponse(response) {
// console.log("Encoded JWT ID token: " + response.credential);
// }
// window.onload = function () {
// google.accounts.id.initialize({
// client_id: "534183685500-ag0vai0jh6todldi4rg6lvp0gcsojk0n.apps.googleusercontent.com",
// callback: handleCredentialResponse
// });
// google.accounts.id.renderButton(
// document.getElementById("buttonDiv"),
// { theme: "outline", size: "390px", } // customization attributes
// );
// google.accounts.id.prompt(); // also display the One Tap dialog
// }
console.log("Encoded JWT ID token: " + response.credential);
}
window.onload = function () {
google.accounts.id.initialize({
client_id: "534183685500-ag0vai0jh6todldi4rg6lvp0gcsojk0n.apps.googleusercontent.com",
callback: handleCredentialResponse
});
google.accounts.id.renderButton(
document.getElementById("buttonDiv"),
{ theme: "outline", size: "390px", } // customization attributes
);
google.accounts.id.prompt(); // also display the One Tap dialog
}
var html=[];
html+='<div style="display: none;" class=nav-login-btn>登入/註冊</div>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment