该扩展为 Yii framework 添加 ApiStore 客户端。
For license information check the LICENSE-file.
Documentation is at https://github.com/12sxa/yii2-apistore/blob/master/docs/guide/README.md.
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist xutongle/yii2-apistore
or add
"xutongle/yii2-apistore": "*"
to the require
section of your composer.json
.
注意:本扩展的二次开发非常简单,我只做了百度的手机归属地查询和身份证查询,这两个就一个方法,只要继承Baidu类即可无限扩展百度的API,
当然也有简单的办法,即直接使用Baidu
类作为api类,获取到实例后如下即可:
$baidu = Yii::$app->apiClientCollection->getApi('baidu');
$response = $baidu->api('apistore/mobilenumber/mobilenumber', 'GET', ['phone' => $mobile]);
var_dump($response);
欢迎fork本代码,并将你的客户端pull给我,我更新到新版里面,另外只要继承基类做类似Baidu
类的实现,即可实现其他非百度ApiStore平台Api接入,已经做好的API有淘宝的IP查询API。
Comments