PHPackages                             yii2-login/login - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. yii2-login/login

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

yii2-login/login
================

QQ登录和微信登录封装在Yii2框架扩展。

112PHP

Since Sep 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/gaoxuxu123/easy-login)[ Packagist](https://packagist.org/packages/yii2-login/login)[ RSS](/packages/yii2-login-login/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\##安装

```

composer require yii2-login dev-master

或者在composer.json中加入

 "require": {

        "yii2-login": "dev-master"
}

```

更新依赖 `composer update`

\##使用说明

\##DEMO

```

public function actionIndex()
    {
        /*$auth = EasyAuth::getInstance('qq');
        $auth->setAppKey('*');
        $auth->setAppSecret('*');
        $auth->setCallback('http:/域名/login/callback?type=qq');
        \Yii::$app->response->redirect($auth->getRequestCodeURL());*/
        $auth = EasyAuth::getInstance('weixin');
        $auth->setAppKey('*');
        $auth->setAppSecret('*');
        $auth->setCallback('http:/域名/login/callback?type=wx');
        \Yii::$app->response->redirect($auth->getRequestCodeURL());
    }
    //回调方法
    public function actionCallback()
    {

        $code  =  \Yii::$app->request->get('code');
        $state =  \Yii::$app->request->get('state');
        $type = \Yii::$app->request->get('type');
        if($type == 'qq'){

            $auth = EasyAuth::getInstance('qq');
            $auth->setAppKey('*');
            $auth->setAppSecret('*');
            $auth->getAccessToken($code);

            $result = $auth->getUserInfo('oauth2.0/me');

        }else if($type == 'wx'){

            $auth = EasyAuth::getInstance('weixin');
            $auth->setAppKey('*');
            $auth->setAppSecret('*');
            $auth->getAccessToken($code);

            $result = $auth->getUserInfo('sns/userinfo');

        }

    }

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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://avatars.githubusercontent.com/u/11934791?v=4)[moxiaoxuancc](/maintainers/gaoxuxu123)[@gaoxuxu123](https://github.com/gaoxuxu123)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/yii2-login-login/health.svg)

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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