This article mainly introduces JS how to call the QQ Internet API to achieve Third-party login, the need for friends can refer to the following
QQ Interconnect JS sdk:http://wiki.connect.qq.com/js_sdk%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e code as follows: <script type =text/javascript> introduced in 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 share button QC. Login ( { btnid: "QQLOGINBTN"//Insert button node id }, function (Reqdata, opts) {//Login Success //According to number of returns According to the Change button display state method var dom = document.getElementById (opts[' Btnid ']), _logouttemplate = [ //avatar ' <span> <img src= ' {figureurl} ' class= ' {size_key} '/></span> ', //nickname ' <span>{nickname}</span > ', //exit ' <span><a href= ' JAVASCRIPT:QC. Login.signout (); " > Exit </a></span> '] . Join (""); dom && (dom.innerhtml = QC. string . Format ( _logouttemplate, { NICKNAME:QC. string . eschtml (Reqdata.nickname),//XSS filtering figureurl:reqdata.figureurl }); }, Function (opts) {//Logoff Success alert (logout successful!!) "); }); //Invoke API Authorization QC.API (" Get_info ", { " Oauth_consumer_key ":" AppID "//This can not be passed }). Success (function (s) { if (QC. Login.check ()) {//Check for successful login and eject OpenID and accesstoken QC. Login.getme (function (openId, Accesstoken) { alert (openid+ "+accesstoken); }); } }); </script> <div class= "Lib_tiv Shadow" > <h3 class= "logo" >QQ login </h3> </div>