1. Go to this page and download the library: Download loveteemo/qqconnect library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php
namespace app\index\controller;
use loveteemo\qqconnect\QC;
class Base
{
public function qqlogin()
{
$qc = new QC();
return redirect($qc->qq_login());
}
}
php
namespace app\index\controller;
use loveteemo\qqconnect\QC;
class Base
{
public function callback()
{
$Qc = new QC();
$access_token = $Qc->qq_callback();
$openid = $Qc->get_openid();
$Qc = new QC($access_token,$openid);
$qq_user_info = $Qc->get_user_info();
//打印数据
//dump($qq_user_info);die;
// ...
// 用户逻辑
return redirect(url('Index/index'));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.