微信登入,qq登入,微博登入之 tp3.2
微博開放平臺文件:http://open.weibo.com/wiki/Connect/login
// QQ登入
public function qqLogin(){
$ qc = new LoginSDK \ Tencent \ QC();
$ QC-> qq_login();
}
首先下載相關SDK;
//微博登入
public function wbLogin(){
$ o = new \ Org \ LoginSDK \ Sae \ SaeTOAuthV2(C('SAE_SDK.WB_AKEY'),C('SAE_SDK.WB_SKEY'));
$ code_url = $ o-> getAuthorizeURL(C('SAE_SDK.WB_CALLBACK_URL'),'code','kqy_wblogin','popup');
return redirect($ code_url);
}
//微信登入
public function wxLogin(){
$ appid = C('WX_SDK.WX_AKEY');
$ redirect_uri = urlencode(C('WX_SDK.WX_CALLBACK_URL'));
$ scope =“snsapi_login”;
$ state =“wxLogin”;
$ URL = “https://open.weixin.qq.com/connect/qrconnect?appid=”。$ APPID。 “&REDIRECT_URI =” $ REDIRECT_URI。“&RESPONSE_TYPE =程式碼&
}