From f0fb593d093525a033e0bdfd41ad14622ec1da57 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 15 Aug 2024 14:11:24 +0800 Subject: [PATCH] * [feedback#6790,done,0.5h] modify return. --- module/webhook/control.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/webhook/control.php b/module/webhook/control.php index 6b5130cb1a..d8d15f43c2 100644 --- a/module/webhook/control.php +++ b/module/webhook/control.php @@ -171,7 +171,7 @@ class webhook extends control } $webhook = $this->webhook->getById($id); - if(!in_array($webhook->type, array('dinguser', 'wechatuser', 'feishuuser'))) return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->webhook->note->bind, 'locate' => $this->createLink('webhook', 'browse')))); + if(!in_array($webhook->type, array('dinguser', 'wechatuser', 'feishuuser'))) return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->webhook->note->bind, 'load' => $this->createLink('webhook', 'browse')))); $webhook->secret = json_decode($webhook->secret); /* Get selected depts. */ @@ -185,8 +185,9 @@ class webhook extends control if($response['result'] == 'fail') { - if($response['message'] == 'nodept') return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->webhook->error->noDept, 'locate' => $this->createLink('webhook', 'chooseDept', "id={$id}")))); - return $this->send(array('result' => 'fail', 'load' => array('alert' => $response['message'], 'locate' => $this->createLink('webhook', 'browse')))); + if($response['message'] == 'nodept') return $this->send(array('result' => 'fail', 'load' => array('alert' => $this->lang->webhook->error->noDept, 'load' => $this->createLink('webhook', 'chooseDept', "id={$id}")))); + if(is_array($response['message'])) $response['message'] = implode(',', $response['message']); + return $this->send(array('result' => 'fail', 'load' => array('alert' => $response['message'], 'load' => $this->createLink('webhook', 'browse')))); } $oauthUsers = $response['data'];