diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index c7b100203..28a122145 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -31,6 +31,7 @@ use think\admin\Storage; use think\admin\storage\AliossStorage; use think\admin\storage\QiniuStorage; use think\admin\storage\TxcosStorage; +use think\exception\HttpException; /** * 系统参数配置. @@ -133,6 +134,9 @@ class Config extends Controller if (!$this->request->isGet() && RuntimeService::check('demo')) { $this->error('演示环境禁止修改系统配置!'); } + if (!in_array($this->request->method(), ['GET', 'POST'], true)) { + throw new HttpException(405, 'Method Not Allowed', null, ['Allow' => 'GET, POST']); + } $this->_applyFormToken(); if ($this->request->isGet()) { $this->type = input('type', 'local'); diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index d8d62e251..d4f3dc782 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -29,6 +29,7 @@ use think\admin\service\AdminService; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; +use think\exception\HttpException; /** * 系统用户管理. @@ -90,6 +91,9 @@ class User extends Controller */ public function pass() { + if (!in_array($this->request->method(), ['GET', 'POST'], true)) { + throw new HttpException(405, 'Method Not Allowed', null, ['Allow' => 'GET, POST']); + } $this->_applyFormToken(); if ($this->request->isGet()) { $this->verify = false;