PHPackages                             wycto/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. wycto/login

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

wycto/login
===========

一个php第三方登录类库

1.0.4(4y ago)257537Apache-2.0PHPPHP &gt;=5.4.0

Since May 15Pushed 4y ago2 watchersCompare

[ Source](https://github.com/wycto/login)[ Packagist](https://packagist.org/packages/wycto/login)[ RSS](/packages/wycto-login/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (8)Used By (0)

PHP第三方登录类库
----------

[](#php第三方登录类库)

### 安装

[](#安装)

```
composer require wycto/login

```

#### 类库列表，持续更新

[](#类库列表持续更新)

```
QQ登录

微信登录

微博登录

```

### 使用方法

[](#使用方法)

```
//登录方法
$name = 'qq',$config = array()
$login = \login\Login::getApp($name,$config);
$login->login();

//登录回调
$name = 'qq',$config = array()
$login = \login\Login::getApp($name,$config);
$login->getUserInfo();

```

### 配置强调

[](#配置强调)

```
$config['framework'] = 'tp';//framework为空使用原生$_SESSION, tp使用thinkphp的session助手函数

```

### QQ登录示例：

[](#qq登录示例)

```
$name = 'qq';
$config = array(
    //开发平台获取
    'app_id' => '101389004',
    //开发平台获取
    'app_key' => '5023acb17c76531a664e995b89e5de07',
    //回掉地址，需要在腾讯开发平台填写
    'callback' => "/index/user/qqcallback",
    'scope' => 'get_user_info',
    'expires_in' => 7775000
);

/**
 * QQ登录
 */
function qqLoginAction()
{
    // qq登录
    $this->_set_referer();
    $login = \login\Login::getApp($name,$config);
    $login->login();
}

/**
 * QQ登录回调
 */
function qqCallbackAction()
{
    $login = \login\Login::getApp($name,$config);
    // 获取用户信息
    $userinfo = $login->getUserInfo();

    if (! isset($userinfo['openid']) || empty($userinfo['openid'])) {
        return $this->redirect(url("index/index/index"));
    }
    // 查询是否存在
    $user = User::get(array(
        'qq_openid' => $userinfo['openid']
    ));
    if ($user) {
        // 账号存在去登录
        return $this->_toLogin($user, false);
    } else {
        // 新注册该用户
        Session::set("qq_userinfo", $userinfo);
        return $this->redirect(url("index/user/newAccount"));
    }
}

```

### 微信登录示例：

[](#微信登录示例)

```
$name = 'weixin';
$config = array(
    //开发平台获取
    'app_id' => 'wx587351c59b2fbca4',
    //开发平台获取
    'app_secret' => '382b75b03fa71c5691555c65037598dc',
    //回掉地址，需要在腾讯开发平台填写
    'callback' => "/default/user/wxcallback",
    //终端类型
    'terminal' => "pc",//pc为电脑端扫码登录，否则微信公众号登录
    //手机端回调地址
    'callback_wx' => "/wap/user/wxcallback",
    //订阅号appid
    'app_id_d' => 'wxae475941e485a3a8',
    //订阅号app_secret
    'app_secret_d' => '3ca2f30daa500012a51b0d126e83eefe'
);

//登录
$login = \login\Login::getApp($name,$config);
$login->login();

//回调获取信息
$login = \login\Login::getApp($name,$config);
$userinfo = $login->getUserInfo();

```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~235 days

Recently: every ~157 days

Total

7

Last Release

1508d ago

Major Versions

0.0.2 → 1.0.02020-07-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/679182a847e3fd819450adbeecbe838b10220ad2974fb695338b58c94cd4643c?d=identicon)[wycto](/maintainers/wycto)

---

Top Contributors

[![wycto](https://avatars.githubusercontent.com/u/16209943?v=4)](https://github.com/wycto "wycto (10 commits)")

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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