PHPackages                             colee/yii2-jos-sdk - 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. [Framework](/categories/framework)
4. /
5. colee/yii2-jos-sdk

ActiveLibrary[Framework](/categories/framework)

colee/yii2-jos-sdk
==================

jos-sdk library for Yii2 framework

284[1 issues](https://github.com/colee1985/yii2-jos-sdk/issues)PHP

Since Jun 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/colee1985/yii2-jos-sdk)[ Packagist](https://packagist.org/packages/colee/yii2-jos-sdk)[ RSS](/packages/colee-yii2-jos-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-jos-sdk
============

[](#yii2-jos-sdk)

---

京东JOS SDK
---------

[](#京东jos-sdk)

---

### 使用方法：

[](#使用方法)

---

添加配置

```
    'components' => [
        'jos'=>[
            'class'=>'colee\jd\jos\JosSdk',
            'appKey'=>'…………',
            'appSecret'=>'…………',
            'redirectUri'=>'http://127.0.0.1:8081/jos/callback'
        ],
    ],
```

使用示例：
-----

[](#使用示例)

获取登录URL

```
$url = \Yii::$app->jos->getLoginUrl('union');
echo Html::a('login', $url,[
    'target'=>'_blank'
]);
```

```
/**
 * 回调地址
 * @param unknown $code
 * @param string $state
 * @return array eg: {
 *    "access_token": "3d951daf-dc60-4808-929c-c578b2587124",
 *    "code": 0,
 *    "expires_in": 86399,
 *    "refresh_token": "465a34ff-dbd4-4930-a87a-80d327c15d20",
 *    "time": "1463473099215",
 *    "token_type": "bearer",
 *    "uid": "2247093760",
 *    "user_nick": "e家洁trs"
 *  }
 */
public function actionCallback($code, $state=false)
{
    $data = \Yii::$app->jos->getTokenByCode($code, $state);
    var_dump($data);
}
```

```
//获取单条推广代码
$res = \Yii::$app->jos->execute('jingdong.service.promotion.getcode', [
    'promotionType'=>'7',
    'materialId'=>'http://item.jd.com/1593025426.html',
    'unionId'=>1000000,
    'subUnionId'=>'qq123',
    'siteSize'=>'',
    'siteId'=>'',
    'channel'=>'PC',
    'webId'=>'543453',
    'extendId'=>'自定义ID',
    'ext1'=>'自定义数据',
], '6c7b3131-8a59-49ad-b3c4-ac9384f72d55');
var_dump($res);

// 联盟查询订单
$res = \Yii::$app->jos->execute('jingdong.UnionOrderService.queryOrders', [
    'time'=>'2016051818',
    'pageIndex'=>1,
    'pageSize'=>20,
    'unionId'=>1000000,
], '6c7b3131-8a59-49ad-b3c4-ac9384f72d55');
var_dump($res);

// 查询业绩
$res = \Yii::$app->jos->execute('jingdong.UnionOrderService.queryCommisions', [
    'time'=>'2016051818',
    'pageIndex'=>1,
    'pageSize'=>20,
    'unionId'=>1000000,
], '6c7b3131-8a59-49ad-b3c4-ac9384f72d55');
var_dump($res);
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

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/db0473ddb3ebe0eed43d1ff2814b70630f0e9373d0878c006307684d2cb3776c?d=identicon)[colee](/maintainers/colee)

---

Top Contributors

[![lidenggao](https://avatars.githubusercontent.com/u/1161635?v=4)](https://github.com/lidenggao "lidenggao (19 commits)")

### Embed Badge

![Health badge](/badges/colee-yii2-jos-sdk/health.svg)

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M843](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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