* Move die to return.

This commit is contained in:
zhujinyong
2022-02-22 14:15:00 +08:00
parent 1f8e1b0021
commit 408f8d4d91
40 changed files with 489 additions and 482 deletions
+8 -8
View File
@@ -181,16 +181,16 @@ class webhook extends control
if($_POST)
{
$this->webhook->bind($id);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return print(js::error(dao::getError()));
die(js::reload('parent'));
return print(js::reload('parent'));
}
$webhook = $this->webhook->getById($id);
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')));
return print(js::locate($this->createLink('webhook', 'browse')));
}
$webhook->secret = json_decode($webhook->secret);
@@ -226,11 +226,11 @@ class webhook extends control
if($response['message'] == 'nodept')
{
echo js::error($this->lang->webhook->error->noDept);
die(js::locate($this->createLink('webhook', 'chooseDept', "id=$id")));
return print(js::locate($this->createLink('webhook', 'chooseDept', "id=$id")));
}
echo js::error($response['message']);
die(js::locate($this->createLink('webhook', 'browse')));
return print(js::locate($this->createLink('webhook', 'browse')));
}
$oauthUsers = $response['data'];
@@ -278,7 +278,7 @@ class webhook extends control
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')));
return print(js::locate($this->createLink('webhook', 'browse')));
}
$webhook->secret = json_decode($webhook->secret);
@@ -299,7 +299,7 @@ class webhook extends control
if($response['result'] == 'fail')
{
echo js::error($response['message']);
die(js::locate($this->createLink('webhook', 'browse')));
return print(js::locate($this->createLink('webhook', 'browse')));
}
if($response['result'] == 'selected')
@@ -307,7 +307,7 @@ class webhook extends control
$locateLink = $this->createLink('webhook', 'bind', "id={$id}");
$locateLink .= strpos($locateLink, '?') !== false ? '&' : '?';
$locateLink .= 'selectedDepts=' . join(',', $response['data']);
die(js::locate($locateLink));
return print(js::locate($locateLink));
}
$this->view->title = $this->lang->webhook->chooseDept;