Add the following information to the body:
//Set the qq sharing button
QC.Login(
{
btnId : "qqLoginBtn" //Insert button Node id
},
function(reqData, opts) {//Login successful
//According to the returned data, change the button display status method
var dom = document.getElementById(opts[ 'btnId']), _logoutTemplate = [
//Avatar
'
',
//Nickname
'
{nickname}',
//Exit
'
Exit' ]
.join("");
dom
&& (dom.innerHTML = QC.String
. format(
_logoutTemplate,
{
nickname : QC.String
.escHTML(reqData.nickname), //Do xss filtering
figureurl : reqData.figureurl
}));
},
function(opts) {//Logout successful
alert("Logout successful! ! ");
});
//Call api authorization
QC.api("get_info", {
"oauth_consumer_key" : "appid" //This does not need to be passed
}) .success(function(s) {
if (QC.Login.check()) {//Check whether the login is successful and pop up openid and accessToken
QC.Login.getMe(function(openId, accessToken) {
alert(openid " " accessToken);
});
}
});
QQ login