* Finish task#44172,task#44273.

This commit is contained in:
leiyong
2021-11-11 05:26:27 +00:00
parent ef338371e1
commit 088a6374df
12 changed files with 273 additions and 17 deletions
+12 -5
View File
@@ -211,14 +211,14 @@ class webhook extends control
elseif($webhook->type == 'wechatuser')
{
$this->app->loadClass('wechatapi', true);
$wechatApi = new wechatapi($webhook->secret->appKey, $webhook->secret->appSecret, $webhook->secret->agentId);
$response = $wechatApi->getAllUsers();
$wechatApi = new wechatapi($webhook->secret->appKey, $webhook->secret->appSecret, $webhook->secret->agentId);
$response = $wechatApi->getAllUsers();
}
elseif($webhook->type == 'feishuuser')
{
$this->app->loadClass('feishuapi', true);
$feishuApi = new feishuapi($webhook->secret->appId, $webhook->secret->appSecret);
$response = $feishuApi->getAllUsers();
$feishuApi = new feishuapi($webhook->secret->appId, $webhook->secret->appSecret);
$response = $feishuApi->getAllUsers($selectedDepts);
}
if($response['result'] == 'fail')
@@ -275,7 +275,7 @@ class webhook extends control
public function chooseDept($id)
{
$webhook = $this->webhook->getById($id);
if($webhook->type != 'dinguser' && $webhook->type != 'wechatuser')
if($webhook->type != 'dinguser' && $webhook->type != 'wechatuser' && $webhook->type != 'feishuuser')
{
echo js::alert($this->lang->webhook->note->bind);
die(js::locate($this->createLink('webhook', 'browse')));
@@ -289,6 +289,13 @@ class webhook extends control
$response = $dingapi->getDeptTree();
}
if($webhook->type == 'feishuuser')
{
$this->app->loadClass('feishuapi', true);
$feishuApi = new feishuapi($webhook->secret->appId, $webhook->secret->appSecret);
$response = $feishuApi->getDeptTree();
}
if($response['result'] == 'fail')
{
echo js::error($response['message']);