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
b9c52570
authored
Jun 21, 2022
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
042b6e97
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
yazhaiTest/lib/login.js
yazhaiTest/lib/login.js
View file @
b9c52570
...
@@ -128,6 +128,7 @@ function loginGo(){
...
@@ -128,6 +128,7 @@ function loginGo(){
function
handleCredentialResponse
(
response
)
{
function
handleCredentialResponse
(
response
)
{
console
.
log
(
"Encoded JWT ID token: "
+
response
.
credential
);
console
.
log
(
"Encoded JWT ID token: "
+
response
.
credential
);
console
.
log
(
response
)
console
.
log
(
response
)
setTimeout
(
function
()
{
setTimeout
(
function
()
{
google
.
accounts
.
id
.
disableAutoSelect
();
google
.
accounts
.
id
.
disableAutoSelect
();
},
1000
);
},
1000
);
...
@@ -149,9 +150,23 @@ function loginGo(){
...
@@ -149,9 +150,23 @@ function loginGo(){
if
(
response
.
status
===
'connected'
)
{
if
(
response
.
status
===
'connected'
)
{
// Logged into your webpage and Facebook.
// Logged into your webpage and Facebook.
FB
.
api
(
'/me'
,
function
(
info
)
{
FB
.
api
(
'/me'
,
function
(
info
)
{
console
.
log
(
'Successful login for: '
+
info
.
name
);
console
.
log
(
'Successful login for: '
+
info
.
name
);
console
.
log
(
info
)
console
.
log
(
response
)
console
.
log
(
response
)
$
.
ajax
({
url
:
$ip
+
'third/login'
,
data
:{
openid
:
382456482257502
,
opentype
:
6
,
authToken
:
response
.
authResponse
.
accessToken
,
// authSecret:r2.twitter.oauth_token_secret,
nickname
:
info
.
name
,
// facepath:p.thumbnail
},
success
:
function
(
data
){
console
.
log
(
'Facebook登录'
,
data
)
}
})
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + response.authResponse.accessToken + "&name=" + info.name + "&id=" + info.id);
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + response.authResponse.accessToken + "&name=" + info.name + "&id=" + info.id);
// document.getElementById('status').innerHTML =
// document.getElementById('status').innerHTML =
// 'Thanks for logging in, ' + response.name + '!';
// 'Thanks for logging in, ' + response.name + '!';
...
@@ -1045,7 +1060,7 @@ function login_twitter(network) { //登录方法,并将twitter 作为参数
...
@@ -1045,7 +1060,7 @@ function login_twitter(network) { //登录方法,并将twitter 作为参数
url
:
$ip
+
'third/login'
,
url
:
$ip
+
'third/login'
,
data
:{
data
:{
openid
:
'cEGECNgXN3ZN00r3Zb82vwh55'
,
openid
:
'cEGECNgXN3ZN00r3Zb82vwh55'
,
opentype
:
8
,
opentype
:
5
,
authToken
:
r2
.
twitter
.
oauth_token
,
authToken
:
r2
.
twitter
.
oauth_token
,
authSecret
:
r2
.
twitter
.
oauth_token_secret
,
authSecret
:
r2
.
twitter
.
oauth_token_secret
,
nickname
:
p
.
name
,
nickname
:
p
.
name
,
...
@@ -1113,6 +1128,7 @@ function testAPI() { // Testing Graph API after login. See
...
@@ -1113,6 +1128,7 @@ function testAPI() { // Testing Graph API after login. See
FB
.
api
(
'/me'
,
function
(
response
)
{
FB
.
api
(
'/me'
,
function
(
response
)
{
console
.
log
(
'Successful login for: '
+
response
.
name
);
console
.
log
(
'Successful login for: '
+
response
.
name
);
// document.getElementById('status').innerHTML =
// document.getElementById('status').innerHTML =
// 'Thanks for logging in, ' + response.name + '!';
// 'Thanks for logging in, ' + response.name + '!';
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + info.authResponse.accessToken + "&name=" + response.name + "&id=" + response.id);
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + info.authResponse.accessToken + "&name=" + response.name + "&id=" + response.id);
...
...
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