PHPackages                             shufazidian/qqconnect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shufazidian/qqconnect

ActiveLibrary

shufazidian/qqconnect
=====================

thinkphp 5 &amp; qqconnect

14PHP

Since Sep 23Pushed 8y agoCompare

[ Source](https://github.com/shufazidian/qqconnect)[ Packagist](https://packagist.org/packages/shufazidian/qqconnect)[ RSS](/packages/shufazidian-qqconnect/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ThinkPHP 5 &amp; Oauth2.0 QQ登录
==============================

[](#thinkphp-5--oauth20-qq登录)

类库是基于Oauth2.0结合ThinkPHP 5 修改部分内容，仅适配 ThinkPhP 5

安装方法
----

[](#安装方法)

composer安装:

```
composer require shufazidian/qqconnect
```

添加公共配置:

```
// QQ 互联配置 在config.php中添加
'qqconnect' => [
    'appid' => '',
    'appkey' => '',
    'callback' => '',
    'scope' => 'get_user_info',
    'errorReport' => true
]
```

示例
--

[](#示例)

### 页面编写:

[](#页面编写)

```
QQ登录

```

### 控制器编写:

[](#控制器编写)

登录

```
namespace app\index\controller;
use shufazidian\qqconnect\QC;
class Base
{
    public function qqlogin()
    {
        $qc = new QC();
        return redirect($qc->qq_login());
    }
}
```

回调

```
namespace app\index\controller;
use shufazidian\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'));
    }
}
```

获取到的QQ数据

```
/**
     * array(18) {
    ["ret"] => int(0)
    ["msg"] => string(0) ""
    ["is_lost"] => int(0)
    ["nickname"] => string(21) "那年，烟雨重楼"
    ["gender"] => string(3) "男"
    ["province"] => string(6) "广东"
    ["city"] => string(6) "深圳"
    ["year"] => string(4) "1993"
    ["figureurl"] => string(73) "http://qzapp.qlogo.cn/qzapp/101232670/7C8F797F30B08554A6E39A537F9A324B/30"
    ["figureurl_1"] => string(73) "http://qzapp.qlogo.cn/qzapp/101232670/7C8F797F30B08554A6E39A537F9A324B/50"
    ["figureurl_2"] => string(74) "http://qzapp.qlogo.cn/qzapp/101232670/7C8F797F30B08554A6E39A537F9A324B/100"
    ["figureurl_qq_1"] => string(69) "http://q.qlogo.cn/qqapp/101232670/7C8F797F30B08554A6E39A537F9A324B/40"
    ["figureurl_qq_2"] => string(70) "http://q.qlogo.cn/qqapp/101232670/7C8F797F30B08554A6E39A537F9A324B/100"
    ["is_yellow_vip"] => string(1) "0"
    ["vip"] => string(1) "0"
    ["yellow_vip_level"] => string(1) "0"
    ["level"] => string(1) "0"
    ["is_yellow_year_vip"] => string(1) "0"
    }
*/
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/83fa5009e2bdcfaee8de3e746718367b0282d0201165e24f5fe91428f1882831?d=identicon)[shufazidian](/maintainers/shufazidian)

---

Top Contributors

[![shufazidian](https://avatars.githubusercontent.com/u/32126566?v=4)](https://github.com/shufazidian "shufazidian (2 commits)")

### Embed Badge

![Health badge](/badges/shufazidian-qqconnect/health.svg)

```
[![Health](https://phpackages.com/badges/shufazidian-qqconnect/health.svg)](https://phpackages.com/packages/shufazidian-qqconnect)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
