PHPackages                             vdong/vdongsdk - 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. vdong/vdongsdk

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

vdong/vdongsdk
==============

第三方登录

1231.x-dev(9y ago)06BSDPHP

Since Jun 7Pushed 9y agoCompare

[ Source](https://github.com/zje454513108/weixin)[ Packagist](https://packagist.org/packages/vdong/vdongsdk)[ RSS](/packages/vdong-vdongsdk/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (3)Used By (0)

OauthSDK
========

[](#oauthsdk)

QQ、微信、微博、第三方登录SDK

安装
--

[](#安装)

使用 Composer 安装:

```
composer require "fakerpp/oauthsdk": "dev-master"

```

### 如何使用

[](#如何使用)

```
html
    QQ登录
    微信登录
    新浪登录
```

```
use OauthSDK\Oauth;

$config =  array(
    //腾讯QQ登录配置
    'QQ' => array(
        'APP_KEY' => '123456', //应用注册成功后分配的 APP ID
        'APP_SECRET' => '9cc9ac2fb17d010104d8a58dbebb4d3a', //应用注册成功后分配的KEY
        'CALLBACK' =>  'http://www.example.com/callback.php?type=qq',//回调URL
    ),
    //新浪微博配置
    'SINA' => array(
        'APP_KEY' => '123456', //应用注册成功后分配的 APP ID
        'APP_SECRET' => '9cc9ac2fb17d010104d8a58dbebb4d3a', //应用注册成功后分配的KEY
        'CALLBACK' => 'http://www.example.com/callback.php?type=sina',//回调URL
    ),
    //腾讯微信配置
    'WECHAT' => array(
        'APP_KEY' => '123456', //应用注册成功后分配的 APP ID
        'APP_SECRET' => '9cc9ac2fb17d010104d8a58dbebb4d3a', //应用注册成功后分配的KEY
        'CALLBACK' => 'http://www.example.com/callback.php?type=wechat',//回调URL
    )
);
//login
$type = $_GET['type'];
$sns = Oauth::getInstance($type,$config);
//跳转到授权页面
header('Location: ' . $sns->getRequestCodeURL());

//callback
$type = $_GET['type'];
$code = $_GET['code'];

(empty($type) || empty($code)) && exit('参数错误');
$sns = Oauth::getInstance($type,$config);
$tokenArr = $sns->getAccessToken($code);

$openid = $tokenArr['openid'];
$token = $tokenArr['access_token'];
//获取当前登录用户信息
if ($openid) {
    $userinfo = $userInfo = $sns->getUserInfo();
    exit( 'SUCCESS');
} else {
    exit('系统出错;请稍后再试！');
}
```

License
=======

[](#license)

MIT

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3310d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24949526?v=4)[zje454513108](/maintainers/zje454513108)[@zje454513108](https://github.com/zje454513108)

---

Top Contributors

[![zje454513108](https://avatars.githubusercontent.com/u/24949526?v=4)](https://github.com/zje454513108 "zje454513108 (6 commits)")

---

Tags

sdkpaywechat

### Embed Badge

![Health badge](/badges/vdong-vdongsdk/health.svg)

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

###  Alternatives

[lokielse/omnipay-wechatpay

Wechat gateway for Omnipay payment processing library

314225.4k7](/packages/lokielse-omnipay-wechatpay)

PHPackages © 2026

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