Commit e90ba620 by libai

测试

parent 3d38d980
...@@ -492,4 +492,5 @@ ...@@ -492,4 +492,5 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
opacity: 0;
} }
...@@ -505,4 +505,5 @@ ...@@ -505,4 +505,5 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
opacity: 0;
} }
\ No newline at end of file
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<link rel="stylesheet" href="css/index.css?v=2022111401"> <link rel="stylesheet" href="css/index.css?v=2022111401">
<link rel="stylesheet" href="css/login.css?v=2022111405"> <link rel="stylesheet" href="css/login.css?v=2022111405">
<script src="https://accounts.google.com/gsi/client" async defer></script> <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>
<style> <style>
.layui-layer-shade { .layui-layer-shade {
opacity: 0.7 !important; opacity: 0.7 !important;
...@@ -260,7 +261,7 @@ ...@@ -260,7 +261,7 @@
<div class="login-line-text">其他方式登入</div> <div class="login-line-text">其他方式登入</div>
<ul class="login-more-btn"> <ul class="login-more-btn">
<li><img src="images/d2.png" alt=""></li> <li><img src="images/d2.png" alt=""></li>
<li><img src="images/d3.png" alt=""></li> <li class="facebook_btn"><img src="images/d3.png" alt=""></li>
<li><img src="images/d4.png" alt=""></li> <li><img src="images/d4.png" alt=""></li>
</ul> </ul>
</div> </div>
......
...@@ -494,7 +494,53 @@ function loginPage(){ ...@@ -494,7 +494,53 @@ function loginPage(){
googleLogin() googleLogin()
$(".login-show").show() $(".login-show").show()
} }
$(".facebook_btn").on("click",function(){
FB.login(function (response) {
if (response.status === 'connected') {
// Logged into your webpage and Facebook.
FB.api('/me', function (info) {
//console.log('Successful login for: ' + info.name);
//console.log(info)
//console.log(response)
$.ajax({
url:$ip+'third/login',
data:{
openid:info.id,
opentype:6,
authToken:response.authResponse.accessToken,
authSecret:'02f716c256cb1aab9299145ede73c13f',
nickname:info.name,
pageID:localStorage.canvasCode,
// facepath:p.thumbnail
},
success:function(data){
//console.log('Facebook登录',data)
localStorage.token=data.token
localStorage.uid=data.uid
$.ajax({
url:$ip+'activeLog/webActive',
data:{
activeType:7,
pageID:localStorage.canvasCode,
uid:localStorage.uid
},
success:function(data){
window.location.reload()
}
})
}
})
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + response.authResponse.accessToken + "&name=" + info.name + "&id=" + info.id);
// document.getElementById('status').innerHTML =
// 'Thanks for logging in, ' + response.name + '!';
// window.location.href = "footseenlogin://" + encodeURIComponent("www.firefly.live?token=" + info.authResponse.accessToken + "&name=" + response.name + "&id=" + response.id);
});
} else {
// The person is not logged into your webpage or we are unable to tell.
}
});
})
function handleCredentialResponse(response) { function handleCredentialResponse(response) {
//console.log("Encoded JWT ID token: " + response.credential); //console.log("Encoded JWT ID token: " + response.credential);
$.ajax({ $.ajax({
......
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