Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
footseen-large-website
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
984b4659
authored
Nov 16, 2022
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
e90ba620
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
mTest/lib/login.js
mTest/lib/login.js
View file @
984b4659
...
...
@@ -583,4 +583,52 @@ function handleCredentialResponse(response) {
// //console.log('Family Name: ' + responsePayload.family_name);
// //console.log("Image URL: " + responsePayload.picture);
// //console.log("Email: " + responsePayload.email);
}
//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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment