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
c54f4f2a
authored
2 years ago
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
bf2f9ece
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
1 deletions
mTest/index.html
mTest/lib/hello.js
mTest/lib/login.js
mTest/index.html
View file @
c54f4f2a
...
...
@@ -38,6 +38,7 @@
<link
rel=
"stylesheet"
href=
"css/login.css?v=2022111602"
>
<script
src=
"https://accounts.google.com/gsi/client"
async
defer
></script>
<script
async
defer
crossorigin=
"anonymous"
src=
"https://connect.facebook.net/en_US/sdk.js"
></script>
<script
src=
"lib/hello.js"
></script>
<style>
.layui-layer-shade
{
opacity
:
0.7
!important
;
...
...
@@ -262,7 +263,7 @@
<ul
class=
"login-more-btn"
>
<li><img
src=
"images/d2.png"
alt=
""
></li>
<li
class=
"facebook_btn"
><img
src=
"images/d3.png"
alt=
""
></li>
<li><img
src=
"images/d4.png"
alt=
""
></li>
<li
class=
"twitter_btn"
><img
src=
"images/d4.png"
alt=
""
></li>
</ul>
</div>
<div
style=
"display: none;"
class=
"login1"
>
...
...
This diff is collapsed.
Click to expand it.
mTest/lib/hello.js
0 → 100644
View file @
c54f4f2a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
mTest/lib/login.js
View file @
c54f4f2a
...
...
@@ -494,6 +494,10 @@ function loginPage(){
googleLogin
()
$
(
".login-show"
).
show
()
}
$
(
'.twitter_btn'
).
on
(
'click'
,
function
()
{
login_twitter
(
'twitter'
);
})
$
(
".facebook_btn"
).
on
(
"click"
,
function
(){
FB
.
login
(
function
(
response
)
{
if
(
response
.
status
===
'connected'
)
{
...
...
@@ -631,4 +635,81 @@ function testAPI() { // Testing Graph API after login. See
// '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
.
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"
));
hello
.
init
(
{
'twitter'
:
'cEGECNgXN3ZN00r3Zb82vwh55'
},
//App_key
{
oauth_proxy
:
'https://auth-server.herokuapp.com/proxy'
,
redirect_uri
:
'https://www.footseen.xyz/mTest/index.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.log(r2.twitter)
$
.
ajax
({
url
:
$ip
+
'third/login'
,
data
:{
openid
:
r2
.
twitter
.
user_id
,
opentype
:
5
,
authToken
:
r2
.
twitter
.
oauth_token
,
authSecret
:
r2
.
twitter
.
oauth_token_secret
,
nickname
:
p
.
name
,
facepath
:
p
.
thumbnail
,
pageID
:
localStorage
.
canvasCode
,
},
success
:
function
(
data
){
//console.log('推特登录',data)
if
(
data
.
code
!=
1
){
layer
.
msg
(
data
.
msg
)
return
;
}
localStorage
.
token
=
data
.
token
localStorage
.
uid
=
data
.
uid
layer
.
closeAll
()
setTimeout
(
function
(){
$
.
ajax
({
url
:
$ip
+
'activeLog/webActive'
,
data
:{
activeType
:
7
,
pageID
:
localStorage
.
canvasCode
,
uid
:
localStorage
.
uid
},
success
:
function
(
data
){
window
.
location
.
reload
()
}
})
},
500
)
}
})
//已获取用户信息,在此处理
// 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 = ;
},
log
);
}
\ No newline at end of file
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