diff --git a/vendor/qiniu/php-sdk/docs/rtc/README.md b/vendor/qiniu/php-sdk/docs/rtc/README.md new file mode 100644 index 000000000..7b98ca0f9 --- /dev/null +++ b/vendor/qiniu/php-sdk/docs/rtc/README.md @@ -0,0 +1,71 @@ +# Rtc Streaming Cloud Server-Side Library For PHP + +## Features + +- Appclient + - [x] 创建房间: client->createApp() + - [x] 查看房间: client->getApp() + - [x] 删除房间: client->deleteApp() + - [x] 生成房间token: client->appToken() + + + +## Contents + +- [Installation](#installation) +- [Usage](#usage) + - [Configuration](#configuration) + - [App](#app) + - [Create a app](#create-a-app) + - [Get a app](#get-a-app) + - [Delete a app](#delete-a-app) + - [Generate a app token](#generate-a-app-token) + + +## Usage + +### App + +#### Create a app + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->createApp("901","testApp"); +print_r($resp); +``` + +#### Get an app + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->getApp("deq02uhb6"); +print_r($resp); +``` + +#### Delete an app + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->deleteApp("deq02uhb6"); +print_r($resp); +``` + +#### Generate an app token + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user'); +print_r($resp); +``` \ No newline at end of file diff --git a/vendor/qiniu/php-sdk/docs/rtc/example.php b/vendor/qiniu/php-sdk/docs/rtc/example.php new file mode 100644 index 000000000..f30b9b415 --- /dev/null +++ b/vendor/qiniu/php-sdk/docs/rtc/example.php @@ -0,0 +1,42 @@ +createApp($hub, $title, $maxUsers); + print_r($resp); + // 获取app状态 + $resp = $client->getApp('dgdl5ge8y'); + print_r($resp); + //修改app状态 + $mergePublishRtmp = null; + $mergePublishRtmp['enable'] = true; + $resp = $client->updateApp('dgdl5ge8y', $hub, $title, $maxUsers, $mergePublishRtmp); + print_r($resp); + //删除app + $resp = $client->deleteApp('dgdl5ge8y'); + print_r($resp); + //获取房间连麦的成员 + $resp=$client->listUser("dgbfvvzid", 'lfxl'); + print_r($resp); + //剔除房间的连麦成员 + $resp=$client->kickUser("dgbfvvzid", 'lfx', "qiniu-f6e07b78-4dc8-45fb-a701-a9e158abb8e6"); + print_r($resp); + // 列举房间 + $resp=$client->listActiveRooms("dgbfvvzid", 'lfx', null, null); + print_r($resp); + //鉴权的有效时间: 1个小时. + $resp = $client->appToken("dgd4vecde", "lfxl", '1111', (time()+3600), 'user'); + print_r($resp); +} catch (\Exception $e) { + echo "Error:", $e, "\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_status.php b/vendor/qiniu/php-sdk/examples/rs_change_status.php new file mode 100644 index 000000000..cbcea5c28 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_status.php @@ -0,0 +1,20 @@ +changeStatus($bucket, $key, $status); +if ($err) { + print_r($err); +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php new file mode 100644 index 000000000..c07ee72f3 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php @@ -0,0 +1,204 @@ +auth = $auth; + + $this->baseURL = sprintf("%s/%s/apps", Config::RTCAPI_HOST, Config::RTCAPI_VERSION); + } + + /* + * hub: 直播空间名 + * title: app 的名称 注意,Title 不是唯一标识,重复 create 动作将生成多个 app + * maxUsers:人数限制 + * NoAutoKickUser: bool 类型,可选,禁止自动踢人(抢流)。默认为 false , + 即同一个身份的 client (app/room/user) ,新的连麦请求可以成功,旧连接被关闭。 + */ + public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null) + { + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if (!empty($noAutoKickUser)) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + $body = json_encode($params); + $ret = $this->post($this->baseURL, $body); + return $ret; + } + + /* + * appId: app 的唯一标识,创建的时候由系统生成。 + * Title: app 的名称, 可选。 + * Hub: 绑定的直播 hub,可选,用于合流后 rtmp 推流。 + * MaxUsers: int 类型,可选,连麦房间支持的最大在线人数。 + * NoAutoKickUser: bool 类型,可选,禁止自动踢人。 + * MergePublishRtmp: 连麦合流转推 RTMP 的配置,可选择。其详细配置包括如下 + Enable: 布尔类型,用于开启和关闭所有房间的合流功能。 + AudioOnly: 布尔类型,可选,指定是否只合成音频。 + Height, Width: int64,可选,指定合流输出的高和宽,默认为 640 x 480。 + OutputFps: int64,可选,指定合流输出的帧率,默认为 25 fps 。 + OutputKbps: int64,可选,指定合流输出的码率,默认为 1000 。 + URL: 合流后转推旁路直播的地址,可选,支持魔法变量配置按照连麦房间号生成不同的推流地址。如果是转推到七牛直播云,不建议使用该配置。 + StreamTitle: 转推七牛直播云的流名,可选,支持魔法变量配置按照连麦房间号生成不同的流名。例如,配置 Hub 为 qn-zhibo ,配置 StreamTitle 为 $(roomName) ,则房间 meeting-001 的合流将会被转推到 rtmp://pili-publish.qn-zhibo.***.com/qn-zhibo/meeting-001地址。详细配置细则,请咨询七牛技术支持。 + */ + public function updateApp($appId, $hub, $title, $maxUsers = null, $mergePublishRtmp = null, $noAutoKickUser = null) + { + $url = $this->baseURL . '/' . $appId; + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if (!empty($noAutoKickUser)) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + if (!empty($mergePublishRtmp)) { + $params['mergePublishRtmp'] = $mergePublishRtmp; + } + $body = json_encode($params); + $ret = $this->post($url, $body); + return $ret; + } + + /* + * appId: app 的唯一标识,创建的时候由系统生成。 + */ + public function getApp($appId) + { + $url = $this->baseURL . '/' . $appId; + $ret = $this->get($url); + return $ret; + } + + /* + * appId: app 的唯一标识,创建的时候由系统生成 + */ + public function deleteApp($appId) + { + $url = $this->baseURL . '/' . $appId; + list(, $err) = $this->delete($url); + return $err; + } + + /* + * 获取房间的人数 + * appId: app 的唯一标识,创建的时候由系统生成。 + * roomName: 操作所查询的连麦房间。 + */ + public function listUser($appId, $roomName) + { + $url = sprintf("%s/%s/rooms/%s/users", $this->baseURL, $appId, $roomName); + $ret = $this->get($url); + return $ret; + } + + /* + * 踢出玩家 + * appId: app 的唯一标识,创建的时候由系统生成。 + * roomName: 连麦房间 + * userId: 请求加入房间的用户ID + */ + public function kickUser($appId, $roomName, $userId) + { + $url = sprintf("%s/%s/rooms/%s/users/%s", $this->baseURL, $appId, $roomName, $userId); + list(, $err) = $this->delete($url); + return $err; + } + + /* + * 获取房间的人数 + * appId: app 的唯一标识,创建的时候由系统生成。 + * prefix: 所查询房间名的前缀索引,可以为空。 + * offset: int 类型,分页查询的位移标记。 + * limit: int 类型,此次查询的最大长度。 + * GET /v3/apps//rooms?prefix=&offset=&limit= + */ + public function listActiveRooms($appId, $prefix = null, $offset = null, $limit = null) + { + if (isset($prefix)) { + $query['prefix'] = $prefix; + } + if (isset($offset)) { + $query['offset'] = $offset; + } + if (isset($limit)) { + $query['limit'] = $limit; + } + if (isset($query) && !empty($query)) { + $query = '?' . http_build_query($query); + $url = sprintf("%s/%s/rooms%s", $this->baseURL, $appId, $query); + } else { + $url = sprintf("%s/%s/rooms", $this->baseURL, $appId); + } + $ret = $this->get($url); + return $ret; + } + + /* + * appId: app 的唯一标识,创建的时候由系统生成。 + * roomName: 房间名称,需满足规格 ^[a-zA-Z0-9_-]{3,64}$ + * userId: 请求加入房间的用户 ID,需满足规格 ^[a-zA-Z0-9_-]{3,50}$ + * expireAt: int64 类型,鉴权的有效时间,传入以秒为单位的64位Unix + 绝对时间,token 将在该时间后失效。 + * permission: 该用户的房间管理权限,"admin" 或 "user",默认为 "user" 。 + 当权限角色为 "admin" 时,拥有将其他用户移除出房间等特权. + */ + public function appToken($appId, $roomName, $userId, $expireAt, $permission) + { + $params['appId'] = $appId; + $params['userId'] = $userId; + $params['roomName'] = $roomName; + $params['permission'] = $permission; + $params['expireAt'] = $expireAt; + $appAccessString = json_encode($params); + return $this->auth->signWithData($appAccessString); + } + + private function get($url, $cType = null) + { + $rtcToken = $this->auth->authorizationV2($url, "GET", null, $cType); + $rtcToken['Content-Type'] = $cType; + $ret = Client::get($url, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function delete($url, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "DELETE", null, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::delete($url, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function post($url, $body, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "POST", $body, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::post($url, $body, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/zoujingli/wechat-developer/Test/mini-login.php b/vendor/zoujingli/wechat-developer/Test/mini-login.php new file mode 100644 index 000000000..2f3bab3d6 --- /dev/null +++ b/vendor/zoujingli/wechat-developer/Test/mini-login.php @@ -0,0 +1,20 @@ + 'wx6bb7b70258da09c6', + 'appsecret' => '78b7b8d65bd67b078babf951d4342b42', +]; + +// 解码数据 +$iv = 'ltM/wT7hsAl0TijEBI4v/g=='; +$code = '013LyiTR0TwjC92QjJRR0mEsTR0LyiT3'; +$decode = 'eIoVtIC2YzLCnrwiIs1IBbXMvC0vyL8bo1IhD38fUQIRbk3lgTWa0Hdw/Ty7NTs3iu7YlqqZBti+cxd6dCfeXBUQwTO2QpbHg0WTeDAdrihsHRHm4dCWdfTx8rzDloGbNOIsKdRElIhUH5YFdiTr5AYiufUDb34cwJ4GNWLAUq4bR0dmFeVEi+3nfwe2MAjGYDl4aq719VLsHodOggK6lXZvM5wjoDyuZsK2dPqJr3/Ji30Z0mdyFq32R4uR3rtJH/h+Rj0+/QmE9QYG7Y6Z48hgPE8cpnhRQNwH49jnC/zKZ9wtDkQ/J8J3Ed2i58zcuY01v8IV+pZ8oBUKXfO5ha+APOxtBSTzyHraU/2RGo8UWtOF6h64OQZhd/UQQy362eyc/qoq8sF9JnEFRP0mRmTDJ+u9oyDhxswCu6x8V73ERWaJeEGSCyjiGpep7/DxZ6eSSBq36OB0BWBkJqsq9Q=='; +$sessionKey = 'OetNxl86B/yMpbwG6wtMEw=='; +$mini = new WeMini\Crypt($config); +echo '
';
+//print_r($mini->session($code));
+print_r($mini->decode($iv, $sessionKey, $decode));
+//print_r($mini->userInfo($code, $iv, $decode));
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/Test/mini-qrc.php b/vendor/zoujingli/wechat-developer/Test/mini-qrc.php
new file mode 100644
index 000000000..f636610e8
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/Test/mini-qrc.php
@@ -0,0 +1,21 @@
+ 'wx6bb7b70258da09c6',
+    'appsecret' => '78b7b8d65bd67b078babf951d4342b42',
+];
+
+$mini = new WeMini\Qrcode($config);
+
+//echo '
';
+try {
+    header('Content-type:image/jpeg');//输出的类型
+//    echo $mini->createDefault('pages/index?query=1');
+//    echo $mini->createMiniScene('432432', 'pages/index/index');
+    echo $mini->createMiniPath('pages/index?query=1');
+} catch (Exception $e) {
+    var_dump($e->getMessage());
+}
diff --git a/vendor/zoujingli/wechat-developer/Test/pay-transfers-create.php b/vendor/zoujingli/wechat-developer/Test/pay-transfers-create.php
new file mode 100644
index 000000000..7e4735c9d
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/Test/pay-transfers-create.php
@@ -0,0 +1,44 @@
+ time(),
+        'openid'           => 'o38gps3vNdCqaggFfrBRCRikwlWY',
+        'check_name'       => 'NO_CHECK',
+        'amount'           => '100',
+        'desc'             => '企业付款操作说明信息',
+        'spbill_create_ip' => '127.0.0.1',
+    ];
+    $result = $wechat->createTransfers($options);
+    echo '
';
+    var_export($result);
+
+} catch (Exception $e) {
+
+    // 出错啦,处理下吧
+    echo $e->getMessage() . PHP_EOL;
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/Test/pay-transfersbank-create.php b/vendor/zoujingli/wechat-developer/Test/pay-transfersbank-create.php
new file mode 100644
index 000000000..92147af19
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/Test/pay-transfersbank-create.php
@@ -0,0 +1,44 @@
+ time(),
+        'enc_bank_no'      => '6212263602037318102',
+        'enc_true_name'    => '邹景立',
+        'bank_code'        => '1002',
+        'amount'           => '100',
+        'desc'             => '打款测试',
+    ];
+    echo '
';
+    $result = $wechat->createTransfersBank($options);
+    var_export($result);
+
+} catch (Exception $e) {
+
+    // 出错啦,处理下吧
+    echo $e->getMessage() . PHP_EOL;
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/Crypt.php b/vendor/zoujingli/wechat-developer/WeMini/Crypt.php
new file mode 100644
index 000000000..70081edf3
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/Crypt.php
@@ -0,0 +1,83 @@
+config->get('appid'), $sessionKey);
+        $errCode = $pc->decryptData($encryptedData, $iv, $data);
+        if ($errCode == 0) {
+            return json_decode($data, true);
+        }
+        return false;
+    }
+
+    /**
+     * 登录凭证校验
+     * @param string $code 登录时获取的 code
+     * @return array
+     */
+    public function session($code)
+    {
+        $appid = $this->config->get('appid');
+        $secret = $this->config->get('appsecret');
+        $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appid}&secret={$secret}&js_code={$code}&grant_type=authorization_code";
+        return json_decode(Tools::get($url), true);
+    }
+
+    /**
+     * 换取用户信息
+     * @param string $code 用户登录凭证(有效期五分钟)
+     * @param string $iv 加密算法的初始向量
+     * @param string $encryptedData 加密数据( encryptedData )
+     * @return array
+     * @throws InvalidDecryptException
+     * @throws InvalidResponseException
+     */
+    public function userInfo($code, $iv, $encryptedData)
+    {
+        $result = $this->session($code);
+        if (empty($result['session_key'])) {
+            throw new InvalidResponseException('Code 换取 SessionKey 失败', 403);
+        }
+        $userinfo = $this->decode($iv, $result['session_key'], $encryptedData);
+        if (empty($userinfo)) {
+            throw  new InvalidDecryptException('用户信息解析失败', 403);
+        }
+        return array_merge($result, $userinfo);
+    }
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/Plugs.php b/vendor/zoujingli/wechat-developer/WeMini/Plugs.php
new file mode 100644
index 000000000..4755ff150
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/Plugs.php
@@ -0,0 +1,98 @@
+registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['action' => 'apply', 'plugin_appid' => $plugin_appid], true);
+    }
+
+    /**
+     * 2.查询已添加的插件
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getList()
+    {
+        $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['action' => 'list'], true);
+    }
+
+    /**
+     * 3.删除已添加的插件
+     * @param string $plugin_appid 插件appid
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function unbind($plugin_appid)
+    {
+        $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['action' => 'unbind', 'plugin_appid' => $plugin_appid], true);
+    }
+
+
+    /**
+     * 4.获取当前所有插件使用方(供插件开发者调用)
+     * @param integer $page 拉取第page页的数据
+     * @param integer $num 表示每页num条记录
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function devApplyList($page = 1, $num = 10)
+    {
+        $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        $data = ['action' => 'dev_apply_list', 'page' => $page, 'num' => $num];
+        return $this->callPostApi($url, $data, true);
+    }
+
+    /**
+     * 5.修改插件使用申请的状态(供插件开发者调用)
+     * @param string $action dev_agree:同意申请;dev_refuse:拒绝申请;dev_delete:删除已拒绝的申请者
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function devAgree($action = 'dev_agree')
+    {
+        $url = 'https://api.weixin.qq.com/wxa/plugin?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['action' => $action], true);
+    }
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/Poi.php b/vendor/zoujingli/wechat-developer/WeMini/Poi.php
new file mode 100644
index 000000000..c81ef5d2d
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/Poi.php
@@ -0,0 +1,91 @@
+registerApi($url, __FUNCTION__, func_get_args());
+        $data = [
+            'related_name'    => $related_name, 'related_credential' => $related_credential,
+            'related_address' => $related_address, 'related_proof_material' => $related_proof_material,
+        ];
+        return $this->callPostApi($url, $data, true);
+    }
+
+    /**
+     * 查看地点列表
+     * @param integer $page 起始页id(从1开始计数)
+     * @param integer $page_rows 每页展示个数(最多1000个)
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getNearByPoiList($page = 1, $page_rows = 1000)
+    {
+        $url = "https://api.weixin.qq.com/wxa/getnearbypoilist?page={$page}&page_rows={$page_rows}&access_token=ACCESS_TOKEN";
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callGetApi($url);
+    }
+
+    /**
+     * 删除地点
+     * @param string $poi_id 附近地点ID
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function delNearByPoiList($poi_id)
+    {
+        $url = "https://api.weixin.qq.com/wxa/delnearbypoi?access_token=ACCESS_TOKEN";
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['poi_id' => $poi_id], true);
+    }
+
+    /**
+     * 展示/取消展示附近小程序
+     * @param string $poi_id 附近地点ID
+     * @param string $status 0:取消展示;1:展示
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function setNearByPoiShowStatus($poi_id, $status)
+    {
+        $url = "https://api.weixin.qq.com/wxa/setnearbypoishowstatus?access_token=ACCESS_TOKEN";
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['poi_id' => $poi_id, 'status' => $status], true);
+    }
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php b/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php
new file mode 100644
index 000000000..a27171247
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/Qrcode.php
@@ -0,0 +1,98 @@
+ "0", "g" => "0", "b" => "0"], $outType = null)
+    {
+        $url = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        $data = ['path' => $path, 'width' => $width, 'auto_color' => $auto_color, 'line_color' => $line_color];
+        $result = Tools::post($url, Tools::arr2json($data));
+        if (json_decode($result)) {
+            return Tools::json2arr($result);
+        }
+        return is_null($outType) ? $result : $outType($result);
+    }
+
+    /**
+     * 获取小程序码(永久有效)
+     * 接口B:适用于需要的码数量极多的业务场景
+     * @param string $scene 最大32个可见字符,只支持数字
+     * @param string $page 必须是已经发布的小程序存在的页面
+     * @param integer $width 二维码的宽度
+     * @param bool $auto_color 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
+     * @param array $line_color auto_color 为 false 时生效
+     * @param null|string $outType 输出类型
+     * @return array|string
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function createMiniScene($scene, $page, $width = 430, $auto_color = false, $line_color = ["r" => "0", "g" => "0", "b" => "0"], $outType = null)
+    {
+        $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN';
+        $data = ['scene' => $scene, 'width' => $width, 'auto_color' => $auto_color, 'page' => $page, 'line_color' => $line_color];
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        $result = Tools::post($url, Tools::arr2json($data));
+        if (json_decode($result)) {
+            return Tools::json2arr($result);
+        }
+        return is_null($outType) ? $result : $outType($result);
+    }
+
+    /**
+     * 获取小程序二维码(永久有效)
+     * 接口C:适用于需要的码数量较少的业务场景
+     * @param string $path 不能为空,最大长度 128 字节
+     * @param integer $width 二维码的宽度
+     * @param null|string $outType 输出类型
+     * @return array|string
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function createDefault($path, $width = 430, $outType = null)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        $result = Tools::post($url, Tools::arr2json(['path' => $path, 'width' => $width]));
+        if (json_decode($result)) {
+            return Tools::json2arr($result);
+        }
+        return is_null($outType) ? $result : $outType($result);
+    }
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/Template.php b/vendor/zoujingli/wechat-developer/WeMini/Template.php
new file mode 100644
index 000000000..516d40741
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/Template.php
@@ -0,0 +1,110 @@
+registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['offset' => '0', 'count' => '20'], true);
+    }
+
+    /**
+     * 获取模板库某个模板标题下关键词库
+     * @param string $template_id 模板标题id,可通过接口获取,也可登录小程序后台查看获取
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getTemplateLibrary($template_id)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['id' => $template_id], true);
+    }
+
+    /**
+     * 组合模板并添加至帐号下的个人模板库
+     * @param string $template_id 模板标题id,可通过接口获取,也可登录小程序后台查看获取
+     * @param array $keyword_id_list 开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如[3,5,4]或[4,5,3]),最多支持10个关键词组合
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function addTemplate($template_id, array $keyword_id_list)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/add?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['id' => $template_id, 'keyword_id_list' => $keyword_id_list], true);
+    }
+
+    /**
+     * 获取帐号下已存在的模板列表
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getTemplateList()
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['offset' => '0', 'count' => '20'], true);
+    }
+
+    /**
+     * 删除模板消息
+     * @param string $template_id 要删除的模板id
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function delTemplate($template_id)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/del?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['template_id' => $template_id], true);
+    }
+
+    /**
+     * 发送模板消息
+     * @param array $data 发送的消息对象数组
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function send(array $data)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, $data, true);
+    }
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/Total.php b/vendor/zoujingli/wechat-developer/WeMini/Total.php
new file mode 100644
index 000000000..9d55a6b5b
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/Total.php
@@ -0,0 +1,176 @@
+registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 访问分析
+     * @param string $begin_date 开始日期
+     * @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidDailyVisittrend($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 周趋势
+     * @param string $begin_date 开始日期,为周一日期
+     * @param string $end_date 结束日期,为周日日期,限定查询一周数据
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidWeeklyVisittrend($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidweeklyvisittrend?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 月趋势
+     * @param string $begin_date 开始日期,为自然月第一天
+     * @param string $end_date 结束日期,为自然月最后一天,限定查询一个月数据
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidMonthlyVisittrend($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyvisittrend?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 访问分布
+     * @param string $begin_date 开始日期
+     * @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidVisitdistribution($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidvisitdistribution?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 日留存
+     * @param string $begin_date 开始日期
+     * @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidDailyRetaininfo($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyretaininfo?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 周留存
+     * @param string $begin_date 开始日期,为周一日期
+     * @param string $end_date 结束日期,为周日日期,限定查询一周数据
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidWeeklyRetaininfo($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidweeklyretaininfo?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 月留存
+     * @param string $begin_date 开始日期,为自然月第一天
+     * @param string $end_date 结束日期,为自然月最后一天,限定查询一个月数据
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidMonthlyRetaininfo($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidmonthlyretaininfo?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 访问页面
+     * @param string $begin_date 开始日期
+     * @param string $end_date 结束日期,限定查询1天数据,end_date允许设置的最大值为昨日
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidVisitPage($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappidvisitpage?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+    /**
+     * 用户画像
+     * @param string $begin_date 开始日期
+     * @param string $end_date 结束日期,开始日期与结束日期相差的天数限定为0/6/29,分别表示查询最近1/7/30天数据,end_date允许设置的最大值为昨日
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getWeanalysisAppidUserportrait($begin_date, $end_date)
+    {
+        $url = 'https://api.weixin.qq.com/datacube/getweanalysisappiduserportrait?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['begin_date' => $begin_date, 'end_date' => $end_date], true);
+    }
+
+}
\ No newline at end of file
diff --git a/vendor/zoujingli/wechat-developer/WeMini/crypt/errorCode.php b/vendor/zoujingli/wechat-developer/WeMini/crypt/errorCode.php
new file mode 100644
index 000000000..a4f8e7267
--- /dev/null
+++ b/vendor/zoujingli/wechat-developer/WeMini/crypt/errorCode.php
@@ -0,0 +1,20 @@
+
+ *    
  • -41001: encodingAesKey 非法
  • + *
  • -41003: aes 解密失败
  • + *
  • -41004: 解密后得到的buffer非法
  • + *
  • -41005: base64加密失败
  • + *
  • -41016: base64解密失败
  • + * + */ +class ErrorCode +{ + public static $OK = 0; + public static $IllegalAesKey = -41001; + public static $IllegalIv = -41002; + public static $IllegalBuffer = -41003; + public static $DecodeBase64Error = -41004; +} \ No newline at end of file diff --git a/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php b/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php new file mode 100644 index 000000000..43769f294 --- /dev/null +++ b/vendor/zoujingli/wechat-developer/WeMini/crypt/wxBizDataCrypt.php @@ -0,0 +1,59 @@ +appid = $appid; + $this->sessionKey = $sessionKey; + include_once __DIR__ . DIRECTORY_SEPARATOR . "errorCode.php"; + } + + /** + * 检验数据的真实性,并且获取解密后的明文. + * @param $encryptedData string 加密的用户数据 + * @param $iv string 与用户数据一同返回的初始向量 + * @param $data string 解密后的原文 + * + * @return int 成功0,失败返回对应的错误码 + */ + public function decryptData($encryptedData, $iv, &$data) + { + if (strlen($this->sessionKey) != 24) { + return \ErrorCode::$IllegalAesKey; + } + $aesKey = base64_decode($this->sessionKey); + if (strlen($iv) != 24) { + return \ErrorCode::$IllegalIv; + } + $aesIV = base64_decode($iv); + $aesCipher = base64_decode($encryptedData); + $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV); + $dataObj = json_decode($result); + if ($dataObj == null) { + return \ErrorCode::$IllegalBuffer; + } + if ($dataObj->watermark->appid != $this->appid) { + return \ErrorCode::$IllegalBuffer; + } + $data = $result; + return \ErrorCode::$OK; + } + +} + diff --git a/vendor/zoujingli/weopen-developer/WeChat/Mini.php b/vendor/zoujingli/weopen-developer/WeChat/Mini.php new file mode 100644 index 000000000..65ddb49a7 --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeChat/Mini.php @@ -0,0 +1,87 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, [], true); + } + + /** + * 2. 关联小程序 + * @param string $miniAppid 小程序appid + * @param integer $notifyUsers 是否发送模板消息通知公众号粉丝 + * @param integer $showProfile 是否展示公众号主页中 + * @return array + * @throws Exceptions\InvalidResponseException + * @throws Exceptions\LocalCacheException + */ + public function linkWxamp($miniAppid, $notifyUsers = 1, $showProfile = 1) + { + $url = "https://api.weixin.qq.com/cgi-bin/wxopen/wxamplink?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, [ + 'appid' => $miniAppid, + 'notify_users' => $notifyUsers, + 'show_profile' => $showProfile, + ]); + } + + /** + * 3.解除已关联的小程序 + * @param string $miniAppid 小程序appid + * @return array + * @throws Exceptions\InvalidResponseException + * @throws Exceptions\LocalCacheException + */ + public function unlinkWxamp($miniAppid) + { + $url = "https://api.weixin.qq.com/cgi-bin/wxopen/wxampunlink?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['appid' => $miniAppid]); + } + + /** + * 第三方平台调用快速注册API完成注册 + * @param string $ticket 公众号扫码授权的凭证(公众平台扫码页面回跳到第三方平台时携带) + * @return array + * @throws Exceptions\InvalidResponseException + * @throws Exceptions\LocalCacheException + */ + public function fastRegister($ticket) + { + $url = 'https://api.weixin.qq.com/cgi-bin/account/fastregister?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['ticket' => $ticket]); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeMini/Account.php b/vendor/zoujingli/weopen-developer/WeMini/Account.php new file mode 100644 index 000000000..569b33019 --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeMini/Account.php @@ -0,0 +1,198 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 2.2 小程序名称设置及改名 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setNickname(array $data) + { + $url = 'https://api.weixin.qq.com/wxa/setnickname?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, $data); + } + + /** + * 2.3 小程序改名审核状态查询 + * @param integer $audit_id 审核单id + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function queryChangeNicknameAuditStatus($audit_id) + { + $url = "https://api.weixin.qq.com/wxa/api_wxa_querynickname?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['audit_id' => $audit_id]); + } + + /** + * + * 2.4 微信认证名称检测 + * @param string $nickname 微信认证名称 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function checkWxVerifyNickname($nickname) + { + $url = "https://api.weixin.qq.com/wxa/api_wxa_querynickname?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['nick_name' => $nickname]); + } + + /** + * 2.5 修改头像 + * @param string $headImgMediaId 头像素材media_id + * @param integer $x1 裁剪框左上角x坐标(取值范围:[0, 1]) + * @param integer $y1 裁剪框左上角y坐标(取值范围:[0, 1]) + * @param integer $x2 裁剪框右下角x坐标(取值范围:[0, 1]) + * @param integer $y2 裁剪框右下角y坐标(取值范围:[0, 1]) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function modifyHeadImage($headImgMediaId, $x1 = 0, $y1 = 0, $x2 = 1, $y2 = 1) + { + $url = "https://api.weixin.qq.com/cgi-bin/account/modifyheadimage?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['head_img_media_id' => $headImgMediaId]); + } + + /** + * 2.6 修改功能介绍 + * @param string $signature 功能介绍(简介) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException] + */ + public function modifySignature($signature) + { + $url = "https://api.weixin.qq.com/cgi-bin/account/modifysignature?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['signature' => $signature]); + } + + /** + * 2.7.3跳转至第三方平台,第三方平台调用快速注册API完成管理员换绑。 + * @param string $taskid 换绑管理员任务序列号(公众平台最终点击提交回跳到第三方平台时携带) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function componentreBindAdmin($taskid) + { + $url = 'https://api.weixin.qq.com/cgi- bin/account/componentrebindadmin?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['taskid' => $taskid]); + } + + /** + * 3.1 获取账号可以设置的所有类目 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getAllCategories() + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/getallcategories?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 3.2 添加类目 + * @param array $categories + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addCategory($categories) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/addcategory?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['categories' => $categories]); + } + + /** + * 3.3 删除类目 + * @param string $first 一级类目ID + * @param string $second 二级类目ID + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function delCategroy($first, $second) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['first' => $first, 'second' => $second]); + } + + /** + * 3.4 获取账号已经设置的所有类目 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getCategory() + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/getcategory?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 3.5 修改类目 + * @param string $first 一级类目ID + * @param string $second 二级类目ID + * @param array $certicates + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function modifyCategory($first, $second, $certicates) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/modifycategory?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['first' => $first, 'second' => $second, 'categories' => $categories]); + } +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeMini/Basic.php b/vendor/zoujingli/weopen-developer/WeMini/Basic.php new file mode 100644 index 000000000..dca27944a --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeMini/Basic.php @@ -0,0 +1,54 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['status' => $status], true); + } + + /** + * 2. 查询小程序当前隐私设置(是否可被搜索) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getWxaSearchStatus() + { + $url = 'https://api.weixin.qq.com/wxa/getwxasearchstatus?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeMini/Code.php b/vendor/zoujingli/weopen-developer/WeMini/Code.php new file mode 100644 index 000000000..e298978f1 --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeMini/Code.php @@ -0,0 +1,397 @@ +registerApi($url, __FUNCTION__, func_get_args()); + $data = [ + 'template_id' => $templateId, + 'ext_json' => $extJson, + 'user_version' => $userVersion, + 'user_desc' => $userDesc, + ]; + return $this->httpPostForJson($url, $data, true); + } + + /** + * 2. 获取体验小程序的体验二维码 + * @param null|string $path 指定体验版二维码跳转到某个具体页面 + * @param null|string $outType 指定输出类型 + * @return array|bool|string + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getQrcode($path = null, $outType = null) + { + $pathStr = is_null($path) ? '' : ("&path=" . urlencode($path)); + $url = "https://api.weixin.qq.com/wxa/get_qrcode?access_token=ACCESS_TOKEN{$pathStr}"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + $result = Tools::get($url); + if (json_decode($result)) { + return Tools::json2arr($result); + } + return is_null($outType) ? $result : $outType($result); + } + + /** + * 3. 获取授权小程序帐号的可选类目 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getCategory() + { + $url = 'https://api.weixin.qq.com/wxa/get_category?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 4. 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getPage() + { + $url = 'https://api.weixin.qq.com/wxa/get_page?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 5. 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用) + * @param array $itemList 提交审核项的一个列表 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function submitAudit(array $itemList) + { + $url = 'https://api.weixin.qq.com/wxa/submit_audit?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['item_list' => $itemList], true); + } + + /** + * 6. 获取审核结果 + * @return array + */ + public function getNotify() + { + return Tools::xml2arr(file_get_contents('php://input')); + } + + /** + * 7. 查询某个指定版本的审核状态(仅供第三方代小程序调用) + * @param string $auditid 提交审核时获得的审核id + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getAuditstatus($auditid) + { + $url = 'https://api.weixin.qq.com/wxa/get_auditstatus?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['auditid' => $auditid], true); + } + + /** + * 8、查询最新一次提交的审核状态(仅供第三方代小程序调用) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getLatestAuditatus() + { + $url = 'https://api.weixin.qq.com/wxa/get_latest_auditstatus?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 9、发布已通过审核的小程序(仅供第三方代小程序调用) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function publishRelease() + { + $url = 'https://api.weixin.qq.com/wxa/release?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, [], true); + } + + /** + * 10、修改小程序线上代码的可见状态(仅供第三方代小程序调用) + * @param string $action 设置可访问状态,发布后默认可访问,close为不可见,open为可见 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function changeVisitStatus($action) + { + $url = 'https://api.weixin.qq.com/wxa/change_visitstatus?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['action' => $action], true); + } + + /** + * 11. 小程序版本回退(仅供第三方代小程序调用) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function revertCodeRelease() + { + $url = 'https://api.weixin.qq.com/wxa/revertcoderelease?access_token=TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 12. 查询当前设置的最低基础库版本及各版本用户占比 (仅供第三方代小程序调用) + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getWeappSupportVersion() + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/getweappsupportversion?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, []); + } + + /** + * 13. 设置最低基础库版本(仅供第三方代小程序调用) + * @param string $version 版本 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setWeappSupportVersion($version) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/setweappsupportversion?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['version' => $version]); + } + + /** + * 14. 设置小程序“扫普通链接二维码打开小程序”能力 + * (1) 增加或修改二维码规则 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addQrcodeJump(array $data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpadd?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, $data); + } + + /** + * 14. 设置小程序“扫普通链接二维码打开小程序”能力 + * (2) 获取已设置的二维码规则 + * @param array $data + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getQrcodeJump(array $data) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpget?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, $data); + } + + /** + * 14. 设置小程序“扫普通链接二维码打开小程序”能力 + * (3)获取校验文件名称及内容 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function downloadQrcodeJump() + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpdownload?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, []); + } + + /** + * 14. 设置小程序“扫普通链接二维码打开小程序”能力 + * (4)删除已设置的二维码规则 + * @param string $prefix 二维码规则 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function deleteQrcodeJump($prefix) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumpdelete?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['prefix' => $prefix]); + } + + /** + * 14. 设置小程序“扫普通链接二维码打开小程序”能力 + * (5)发布已设置的二维码规则 + * @param string $prefix 二维码规则 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function publishQrcodeJump($prefix) + { + $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/qrcodejumppublish?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['prefix' => $prefix]); + } + + /** + * 16. 小程序审核撤回 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function undoCodeAudit() + { + $url = 'https://api.weixin.qq.com/wxa/undocodeaudit?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 17.小程序分阶段发布 + * (1)分阶段发布接口 + * @param integer $gray_percentage 灰度的百分比,1到100的整数 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function grayRelease($gray_percentage) + { + $url = 'https://api.weixin.qq.com/wxa/grayrelease?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['gray_percentage' => $gray_percentage]); + } + + /** + * 17.小程序分阶段发布 + * (2)取消分阶段发布 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function revertGrayRelease() + { + $url = 'https://api.weixin.qq.com/wxa/revertgrayrelease?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 17.小程序分阶段发布 + * (3)查询当前分阶段发布详情 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getGrayreLeasePlan() + { + $url = 'https://api.weixin.qq.com/wxa/getgrayreleaseplan?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 1、获取草稿箱内的所有临时代码草稿 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getTemplateDraftList() + { + $url = 'https://api.weixin.qq.com/wxa/gettemplatedraftlist?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 2、获取代码模版库中的所有小程序代码模版 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getTemplateList() + { + $url = 'https://api.weixin.qq.com/wxa/gettemplatelist?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpGetForJson($url); + } + + /** + * 3、将草稿箱的草稿选为小程序代码模版 + * @param integer $draft_id 草稿ID,本字段可通过“ 获取草稿箱内的所有临时代码草稿 ”接口获得 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function addToTemplate($draft_id) + { + $url = 'https://api.weixin.qq.com/wxa/grayrelease?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['draft_id' => $draft_id]); + } + + /** + * 4、删除指定小程序代码模版 + * @param integer $template_id 要删除的模版ID + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function deleteTemplate($template_id) + { + $url = 'https://api.weixin.qq.com/wxa/deletetemplate?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['template_id' => $template_id]); + } +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeMini/Domain.php b/vendor/zoujingli/weopen-developer/WeMini/Domain.php new file mode 100644 index 000000000..7751e2a77 --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeMini/Domain.php @@ -0,0 +1,60 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, $data, true); + } + + /** + * 2、设置小程序业务域名(仅供第三方代小程序调用) + * @param string $action add添加, delete删除, set覆盖, get获取。 + * 当参数是get时不需要填webviewdomain字段。 + * 如果没有action字段参数,则默认见开放平台第三方登记的小程序业务域名全部添加到授权的小程序中 + * @param string $webviewdomain 小程序业务域名,当action参数是get时不需要此字段 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function setWebViewDomain($action, $webviewdomain) + { + $url = 'https://api.weixin.qq.com/wxa/setwebviewdomain?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['action' => $action, 'webviewdomain' => $webviewdomain], true); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeMini/Tester.php b/vendor/zoujingli/weopen-developer/WeMini/Tester.php new file mode 100644 index 000000000..9b0828e91 --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeMini/Tester.php @@ -0,0 +1,68 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['wechatid' => $testid], true); + } + + /** + * 2、解除绑定小程序的体验者 + * @param string $testid 微信号 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function unbindTester($testid) + { + $url = 'https://api.weixin.qq.com/wxa/unbind_tester?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['wechatid' => $testid], true); + } + + /** + * 3. 获取体验者列表 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function getTesterList() + { + $url = 'https://api.weixin.qq.com/wxa/memberauth?access_token=ACCESS_TOKEN'; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['action' => 'get_experiencer'], true); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeMini/User.php b/vendor/zoujingli/weopen-developer/WeMini/User.php new file mode 100644 index 000000000..d75208a2a --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeMini/User.php @@ -0,0 +1,83 @@ +registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['appid' => $appid], true); + } + + /** + * 2. 将公众号/小程序绑定到开放平台帐号下 + * @param string $appid 授权公众号或小程序的appid + * @param string $openAppid 开放平台帐号appid + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function bind($appid, $openAppid) + { + $url = "https://api.weixin.qq.com/cgi-bin/open/bind?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['appid' => $appid, 'open_appid' => $openAppid]); + } + + /** + * 3. 将公众号/小程序从开放平台帐号下解绑 + * @param string $appid 授权公众号或小程序的appid + * @param string $openAppid 开放平台帐号appid + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function unbind($appid, $openAppid) + { + $url = "https://api.weixin.qq.com/cgi-bin/open/unbind?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['appid' => $appid, 'open_appid' => $openAppid]); + } + + /** + * 3. 获取公众号/小程序所绑定的开放平台帐号 + * @param string $appid 授权公众号或小程序的appid + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + * @throws \WeChat\Exceptions\LocalCacheException + */ + public function get($appid) + { + $url = "https://api.weixin.qq.com/cgi-bin/open/unbind?access_token=ACCESS_TOKEN"; + $this->registerApi($url, __FUNCTION__, func_get_args()); + return $this->httpPostForJson($url, ['appid' => $appid]); + } +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeOpen/Login.php b/vendor/zoujingli/weopen-developer/WeOpen/Login.php new file mode 100644 index 000000000..a8b8cd0e6 --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeOpen/Login.php @@ -0,0 +1,110 @@ +config = new DataArray($options); + if (empty($options['appid'])) { + throw new InvalidArgumentException("Missing Config -- [appid]"); + } + if (empty($options['appsecret'])) { + throw new InvalidArgumentException("Missing Config -- [appsecret]"); + } + } + + /** + * 第一步:请求CODE + * @param string $redirectUri 请使用urlEncode对链接进行处理 + * @return string + */ + public function auth($redirectUri) + { + $appid = $this->config->get('appid'); + $redirectUri = urlencode($redirectUri); + return "https://open.weixin.qq.com/connect/qrconnect?appid={$appid}&redirect_uri=${$redirectUri}&response_type=code&scope=snsapi_login&state={$appid}#wechat_redirect"; + } + + /** + * 第二步:通过code获取access_token + * @return mixed + */ + public function getAccessToken() + { + $appid = $this->config->get('appid'); + $secret = $this->config->get('appsecret'); + $code = isset($_GET['code']) ? $_GET['code'] : ''; + $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$appid}&secret={$secret}&code={$code}&grant_type=authorization_code"; + return json_decode(Tools::get($url)); + } + + /** + * 刷新AccessToken有效期 + * @param string $refreshToken + * @return array + */ + public function refreshToken($refreshToken) + { + $appid = $this->config->get('appid'); + $url = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid={$appid}&grant_type=refresh_token&refresh_token={$refreshToken}"; + return json_decode(Tools::get($url)); + } + + /** + * 检验授权凭证(access_token)是否有效 + * @param string $accessToken 调用凭证 + * @param string $openid 普通用户的标识,对当前开发者帐号唯一 + * @return array + */ + public function checkAccessToken($accessToken, $openid) + { + $url = "https://api.weixin.qq.com/sns/auth?access_token={$accessToken}&openid={$openid}"; + return json_decode(Tools::get($url)); + } + + /** + * 获取用户个人信息(UnionID机制) + * @param string $accessToken 调用凭证 + * @param string $openid 普通用户的标识,对当前开发者帐号唯一 + * @return array + */ + public function getUserinfo($accessToken, $openid) + { + $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$accessToken}&openid={$openid}"; + return json_decode(Tools::get($url)); + } + +} \ No newline at end of file diff --git a/vendor/zoujingli/weopen-developer/WeOpen/MiniApp.php b/vendor/zoujingli/weopen-developer/WeOpen/MiniApp.php new file mode 100644 index 000000000..6732503cc --- /dev/null +++ b/vendor/zoujingli/weopen-developer/WeOpen/MiniApp.php @@ -0,0 +1,72 @@ +config->get('component_appid'); + $component_access_token = $this->getComponentAccessToken(); + $url = "https://api.weixin.qq.com/sns/component/jscode2session?appid={$appid}&js_code={$code}&grant_type=authorization_code&component_appid={$component_appid}&component_access_token={$component_access_token}"; + return json_decode(Tools::get($url), true); + } + + /** + * 1.注册流程及接口说明 + * @param string $authorizerAppid 公众号的appid + * @param integer $copyWxVerify 是否复用公众号的资质进行微信认证(1:申请复用资质进行微信 认证 0:不申请) + * @param string $redirectUri 用户扫码授权后,MP 扫码页面将跳转到该地址(注:1.链接需 urlencode 2.Host 需和第三方平台在微信开放平台上面填写的登 录授权的发起页域名一致) + * @return string + */ + public function getCopyRegisterMiniUrl($authorizerAppid, $copyWxVerify, $redirectUri) + { + $redirectUri = urlencode($redirectUri); + $componentAppid = $this->config->get('component_appid'); + return "https://mp.weixin.qq.com/cgi-bin/fastregisterauth?appid={$authorizerAppid}&component_appid={$componentAppid}©_wx_verify={$copyWxVerify}&redirect_uri={$redirectUri}"; + } + + + /** + * 2.7.1 从第三方平台跳转至微信公众平台授权注册页面 + * @param string $authorizerAppid 公众号的 appid + * @param string $redirectUri 新管理员信息填写完成点击提交后,将跳转到该地址 + * @return string + */ + public function getComponentreBindAdmin($authorizerAppid, $redirectUri) + { + $redirectUri = urlencode($redirectUri); + $componentAppid = $this->config->get('component_appid'); + return "https://mp.weixin.qq.com/wxopen/componentrebindadmin?appid={$authorizerAppid}&component_appid={$componentAppid}&redirect_uri={$redirectUri}"; + } + + +}