mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-10-05 08:29:57 +08:00
Update Menu.php
This commit is contained in:
parent
0ba4005f01
commit
c5b5f300b6
@ -77,29 +77,25 @@ class Menu extends Controller
|
|||||||
{
|
{
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
$data = $this->request->post('data');
|
$data = $this->request->post('data');
|
||||||
if (empty($data)) { // 删除菜单
|
if (empty($data)) try {
|
||||||
try {
|
WechatService::WeChatMenu()->delete();
|
||||||
WechatService::WeChatMenu()->delete();
|
sysoplog('微信管理', '删除微信菜单成功');
|
||||||
sysoplog('微信管理', '删除微信菜单成功');
|
$this->success('删除微信菜单成功!', '');
|
||||||
$this->success('删除微信菜单成功!', '');
|
} catch (HttpResponseException $exception) {
|
||||||
} catch (HttpResponseException $exception) {
|
throw $exception;
|
||||||
throw $exception;
|
} catch (\Exception $exception) {
|
||||||
} catch (\Exception $exception) {
|
sysoplog('微信管理', "删除微信菜单失败:{$exception->getMessage()}");
|
||||||
sysoplog('微信管理', "删除微信菜单失败:{$exception->getMessage()}");
|
$this->error("删除微信菜单失败,请稍候再试!<br>{$exception->getMessage()}");
|
||||||
$this->error("删除微信菜单失败,请稍候再试!<br>{$exception->getMessage()}");
|
} else try {
|
||||||
}
|
sysdata($this->ckey, $this->_buildMenuData(json_decode($data, true)));
|
||||||
} else {
|
WechatService::WeChatMenu()->create(['button' => sysdata($this->ckey)]);
|
||||||
try {
|
sysoplog('微信管理', '发布微信菜单成功');
|
||||||
sysdata($this->ckey, $this->_buildMenuData(json_decode($data, true)));
|
$this->success('保存发布菜单成功!', '');
|
||||||
WechatService::WeChatMenu()->create(['button' => sysdata($this->ckey)]);
|
} catch (HttpResponseException $exception) {
|
||||||
sysoplog('微信管理', '发布微信菜单成功');
|
throw $exception;
|
||||||
$this->success('保存发布菜单成功!', '');
|
} catch (\Exception $exception) {
|
||||||
} catch (HttpResponseException $exception) {
|
sysoplog('微信管理', "发布微信菜单失败:{$exception->getMessage()}");
|
||||||
throw $exception;
|
$this->error("微信菜单发布失败,请稍候再试!<br> {$exception->getMessage()}");
|
||||||
} catch (\Exception $exception) {
|
|
||||||
sysoplog('微信管理', "发布微信菜单失败:{$exception->getMessage()}");
|
|
||||||
$this->error("微信菜单发布失败,请稍候再试!<br> {$exception->getMessage()}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user