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
8d881068
authored
2 years ago
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
fc17fa8e
master
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletions
yazhaiTest/lib/login.js
yazhaiTest/pc.html
yazhaiTest/lib/login.js
View file @
8d881068
...
...
@@ -8,7 +8,7 @@ function loginGo(){
html
+=
' <div class="google-login-btn" id="buttonDiv"></div>'
;
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 src="https://www.footseen.xyz/yazhaiTest/images/login-icon2.png" alt=""></div>'
;
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 src="https://www.footseen.xyz/yazhaiTest/images/login-icon4.png" alt=""></div>'
;
html
+=
' </div>'
;
...
...
@@ -979,3 +979,52 @@ function loginLayer(){
}
})
}
$
(
'#twitter_btn'
).
on
(
'click'
,
function
()
{
login_twitter
(
'twitter'
);
})
//twitter
window
.
twttr
=
(
function
(
d
,
s
,
id
)
{
var
js
,
fjs
=
d
.
getElementsByTagName
(
s
)[
0
],
t
=
window
.
twttr
||
{};
if
(
d
.
getElementById
(
id
))
return
t
;
js
=
d
.
createElement
(
s
);
js
.
id
=
id
;
js
.
src
=
"https://platform.twitter.com/widgets.js"
;
fjs
.
parentNode
.
insertBefore
(
js
,
fjs
);
t
.
_e
=
[];
t
.
ready
=
function
(
f
)
{
t
.
_e
.
push
(
f
);
};
return
t
;
}(
document
,
"script"
,
"twitter-wjs"
));
var
log
=
console
.
log
;
hello
.
init
(
{
'twitter'
:
'cEGECNgXN3ZN00r3Zb82vwh55'
},
//App_key
{
oauth_proxy
:
'https://auth-server.herokuapp.com/proxy'
,
redirect_uri
:
'https://www.footseen.xyz/yazhaiTest/pc.html'
});
function
login_twitter
(
network
)
{
//登录方法,并将twitter 作为参数传入
// Twitter instance
var
twitter
=
hello
(
network
);
// Login
twitter
.
login
().
then
(
function
(
r
)
{
// Get Profile
return
twitter
.
api
(
'me'
)
},
log
).
then
(
function
(
p
)
{
var
r2
=
JSON
.
parse
(
localStorage
.
getItem
(
'hello'
));
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);
// if (p) {
// }
},
log
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
yazhaiTest/pc.html
View file @
8d881068
...
...
@@ -18,6 +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>
</head>
<body
style=
"background: #F4F5F8"
>
...
...
This diff is collapsed.
Click to expand it.
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