Commit edf89bb8 by libai

测试

parent 36056049
Showing with 9 additions and 6 deletions
......@@ -1008,7 +1008,7 @@ hello.init(
{ 'twitter': 'cEGECNgXN3ZN00r3Zb82vwh55' }, //App_key
{
oauth_proxy: 'https://auth-server.herokuapp.com/proxy',
redirect_uri: 'https://www.footseen.xyz/yazhaiTest/pc.html'
// redirect_uri: 'https://www.footseen.xyz/yazhaiTest/pc.html'
});
function login_twitter(network) { //登录方法,并将twitter 作为参数传入
// Twitter instance
......@@ -1017,13 +1017,16 @@ function login_twitter(network) { //登录方法,并将twitter 作为参数
// Login
twitter.login().then(function (r) {
// Get Profile
return twitter.api('me')
return twitter.api('/me')
}, log).then(function (p) {
console.log(r2)
var r2 = JSON.parse(localStorage.getItem('hello'));
console.log(r2)
var response = {'id':p.id,'first_name':p.name,'last_name':p.last_name,'picture':p.thumbnail,'link':'https://twitter.com/'+p.screen_name,'login_type':'twitter'};
console.dir(response);
// var r2 = JSON.parse(localStorage.getItem('hello'));
console.dir(p);
console.log(r2.twitter)
// console.dir(p);
// console.log(r2.twitter)
//已获取用户信息,在此处理
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?secret=" + r2.twitter.oauth_token_secret + "&token=" + r2.twitter.oauth_token + "&name=" + p.name + "&profileImageUrl=" + p.thumbnail + "&id=" + r2.twitter.user_id);
// window.location.href = ;
......
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