diff --git a/app/Http/Admin/Controllers/Controller.php b/app/Http/Admin/Controllers/Controller.php index 058bfa77..25899d50 100644 --- a/app/Http/Admin/Controllers/Controller.php +++ b/app/Http/Admin/Controllers/Controller.php @@ -21,6 +21,17 @@ class Controller extends \Phalcon\Mvc\Controller public function beforeExecuteRoute(Dispatcher $dispatcher) { + /** + * demo分支拒绝数据提交 + */ + if ($this->isNotSafeRequest()) { + $dispatcher->forward([ + 'controller' => 'public', + 'action' => 'forbidden', + ]); + return false; + } + if ($this->isNotSafeRequest()) { $this->checkHttpReferer(); $this->checkCsrfToken(); diff --git a/app/Http/Admin/Controllers/SettingController.php b/app/Http/Admin/Controllers/SettingController.php index 7452c717..71e41fc0 100644 --- a/app/Http/Admin/Controllers/SettingController.php +++ b/app/Http/Admin/Controllers/SettingController.php @@ -327,29 +327,4 @@ class SettingController extends Controller } } - /** - * @Route("/wechat", name="admin.setting.wechat") - */ - public function wechatAction() - { - $settingService = new SettingService(); - - if ($this->request->isPost()) { - - $section = $this->request->getPost('section', 'string'); - - $data = $this->request->getPost(); - - $settingService->updateSettings($section, $data); - - return $this->jsonSuccess(['msg' => '更新配置成功']); - - } else { - - $oa = $settingService->getWeChatOASettings(); - - $this->view->setVar('oa', $oa); - } - } - } diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 52d6bf1e..427c9924 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -750,12 +750,6 @@ class AuthNode extends Service 'type' => 'menu', 'route' => 'admin.setting.oauth', ], - [ - 'id' => '5-1-13', - 'title' => '微信公众平台', - 'type' => 'menu', - 'route' => 'admin.setting.wechat', - ], ], ], ], diff --git a/app/Http/Admin/Services/Setting.php b/app/Http/Admin/Services/Setting.php index 3b744ad8..d6d46164 100644 --- a/app/Http/Admin/Services/Setting.php +++ b/app/Http/Admin/Services/Setting.php @@ -57,16 +57,6 @@ class Setting extends Service return $wxpay; } - public function getWeChatOASettings() - { - $oa = $this->getSettings('wechat.oa'); - - $oa['auth_url'] = $oa['auth_url'] ?: kg_full_url(['for' => 'home.wechat.oa.auth_callback']); - $oa['notify_url'] = $oa['notify_url'] ?: kg_full_url(['for' => 'home.wechat.oa.notify_callback']); - - return $oa; - } - public function getVipSettings() { $vipRepo = new VipRepo(); @@ -97,8 +87,16 @@ class Setting extends Service $result = []; + /** + * demo分支过滤敏感数据 + */ if ($items->count() > 0) { foreach ($items as $item) { + $case1 = preg_match('/(id|auth|key|secret|password|pwd)$/', $item->item_key); + $case2 = $this->dispatcher->getControllerName() == 'setting'; + if ($case1 && $case2) { + $item->item_value = '***'; + } $result[$item->item_key] = $item->item_value; } } diff --git a/app/Http/Admin/Views/setting/wechat.volt b/app/Http/Admin/Views/setting/wechat.volt deleted file mode 100644 index a37d7091..00000000 --- a/app/Http/Admin/Views/setting/wechat.volt +++ /dev/null @@ -1,16 +0,0 @@ -{% extends 'templates/main.volt' %} - -{% block content %} - -