master
fengyuexingzi 8 years ago
parent 73c12bcafb
commit edbfba66ce

@ -30,11 +30,12 @@
function fbLogin() { function fbLogin() {
FB.getLoginStatus(function (response) { FB.getLoginStatus(function (response) {
if (response.status === 'connected') { if (response.status === 'connected') {
console.log("login in"); fbCallInfo(response);
console.log(response);
} else { } else {
FB.login(function (response) { FB.login(function (response) {
console.log(response); if (response.status === 'connected'){
fbCallInfo(response);
}
}, {scope: 'public_profile,email'}); }, {scope: 'public_profile,email'});
} }
}); });
@ -52,6 +53,27 @@
} }
}); });
} }
// send info to server
function fbCallInfo(response) {
$.ajax({
url: '',
type: 'post',
ContentType: 'json',
data: response,
dateTyep: 'json',
success: function (data, status) {
if (status == 'success') {
console.log(data);
} else {
console.log(status);
}
},
error: function (xhr, error) {
console.log(error);
}
});
}
</script> </script>

Loading…
Cancel
Save