Commit 06cf5c9f by libai

测试

parent f1fd6d8d
......@@ -69,6 +69,7 @@
}
.more-login-box .more-login-icon img {
width: 68px;
cursor: pointer;
}
.login-input-area {
position: relative;
......
......@@ -68,6 +68,7 @@
font-size: 0;
img{
width: 68px;
cursor: pointer;
}
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,7 +9,7 @@ function loginGo(){
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 id="twitter_btn" src="https://www.footseen.xyz/yazhaiTest/images/login-icon2.png" alt=""></div>';
html+=' <div class="more-login-icon"><img src="https://www.footseen.xyz/yazhaiTest/images/login-icon3.png" alt=""></div>';
html+=' <div class="more-login-icon"><img class="facebook_btn" src="https://www.footseen.xyz/yazhaiTest/images/login-icon3.png" alt=""></div>';
html+=' <div class="more-login-icon"><img src="https://www.footseen.xyz/yazhaiTest/images/login-icon4.png" alt=""></div>';
html+=' </div>';
html+=' </div>';
......@@ -141,7 +141,24 @@ function loginGo(){
login_twitter('twitter');
})
$('.facebook_btn').on('click', function () {
FB.login(function (response) {
if (response.status === 'connected') {
// Logged into your webpage and Facebook.
FB.api('/me', function (info) {
console.log('Successful login for: ' + info.name);
console.log(response)
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + response.authResponse.accessToken + "&name=" + info.name + "&id=" + info.id);
// document.getElementById('status').innerHTML =
// 'Thanks for logging in, ' + response.name + '!';
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + info.authResponse.accessToken + "&name=" + response.name + "&id=" + response.id);
});
} else {
// The person is not logged into your webpage or we are unable to tell.
}
});
})
function googleLogin(){
google.accounts.id.initialize({
......@@ -1026,4 +1043,51 @@ function login_twitter(network) { //登录方法,并将twitter ä½œä¸ºå‚æ•°ä¼
// window.location.href = ;
}, log);
}
//facebook
var info;
function statusChangeCallback(response) { // Called with the results from FB.getLoginStatus().
console.log('statusChangeCallback');
console.log(response); // The current login status of the person.
if (response.status === 'connected') { // Logged into your webpage and Facebook.
info = response
testAPI();
} else { // Not logged into your webpage or we are unable to tell.
// document.getElementById('status').innerHTML = 'Please log ' +
// 'into this webpage.';
}
}
function checkLoginState() { // Called when a person is finished with the Login Button.
FB.getLoginStatus(function (response) { // See the onlogin handler
statusChangeCallback(response);
});
}
window.fbAsyncInit = function () {
FB.init({
appId: '382456482257502',
cookie: true, // Enable cookies to allow the server to access the session.
xfbml: true, // Parse social plugins on this webpage.
version: 'v13.0' // Use this Graph API version for this call.
});
FB.getLoginStatus(function (response) { // Called after the JS SDK has been initialized.
statusChangeCallback(response); // Returns the login status.
});
};
function testAPI() { // Testing Graph API after login. See statusChangeCallback() for when this call is made.
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function (response) {
console.log('Successful login for: ' + response.name);
// document.getElementById('status').innerHTML =
// 'Thanks for logging in, ' + response.name + '!';
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + info.authResponse.accessToken + "&name=" + response.name + "&id=" + response.id);
});
}
\ No newline at end of file
......@@ -18,7 +18,7 @@
<link rel="stylesheet" href="css/neck.css">
<link rel="stylesheet" href="css/login.css?v=20220620">
<script src="https://accounts.google.com/gsi/client" async defer></script>
<script src="https://adodson.com/hello.js/dist/hello.all.js"></script>
<script src="lib/hello.js"></script>
</head>
<body style="background: #F4F5F8">
......@@ -316,6 +316,7 @@
<script src="lib/fingerprint2.js"></script>
<script src="lib/default.js?v='20220407'"></script>
<script src="lib/login.js?v=20220620"></script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<script>
$(function(){
// var html=[]
......
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