Commit b9c52570 by libai

测试

parent 042b6e97
Showing with 18 additions and 2 deletions
...@@ -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);
......
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