qq Internet js SDK: http://wiki.connect.qq.com/js_sdk%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
The code copy is as follows:
<script type=text/javascript>
Introduced in the page header: <script type="text/javascript"
src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js"
data-appid="appid" data-redirecturi="huidiaodizhi(with http)"
charset="utf-8"></script>
Add the following information to the body:
//Set QQ Sharing Button
QC.Login(
{
btnId: "qqLoginBtn" //Node id of the insert button
},
function(reqData, opts) {//Login successfully
//Change the button to display status according to the return data
var dom = document.getElementById(opts['btnId']), _logoutTemplate = [
//avatar
'<span><img src="{figureurl}"/></span>',
//Nick name
'<span>{nickname}</span>',
//quit
'<span><a href="javascript:QC.Login.signOut();">Exit</a></span>' ]
.join("");
dom
&& (dom.innerHTML = QC.String
.format(
_logoutTemplate,
{
nickname : QC.String
.escHTML(reqData.nickname), //Do xss filter
figureurl : reqData.figureurl
}));
},
function(opts) {//Log off successfully
alert("Logout successfully!!");
});
//Call API authorization
QC.api("get_info", {
"oauth_consumer_key" : "appid" //This can be passed without
}).success(function(s) {
if (QC.Login.check()) {//Check whether the login is successful, and openid and accessToken pop up
QC.Login.getMe(function(openId, accessToken) {
alert(openid+" "+accessToken);
});
}
});
</script>
<div>
<h3>QQ Login</h3>
</div>