Created
December 9, 2015 19:15
-
-
Save LinZap/490c99dae93a0d9fcb26 to your computer and use it in GitHub Desktop.
Zap_OAuth JavaScript SDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>SESSION</title> | |
</head> | |
<body> | |
<button id="btn">請求</button> | |
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> | |
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> | |
<script> | |
(function(d, s, id){ | |
var appid = "123456"; | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "//10.21.20.85/session/sdk.js.php?appid="+appid; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'zap-sdk')); | |
</script> | |
<script> | |
$(function(){ | |
$("#btn").click(function(event) { | |
Zap.login(function(data){ | |
console.log(data); | |
},'user-profile'); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
說明
10.21.20.85/session/
這台是 OAuth Server
10.74.23.144/session/
這台是 Client
詳情
這是前端要用第三方驗證時,真實的寫法