diff --git a/extend/catcher/base/CatchRequest.php b/extend/catcher/base/CatchRequest.php index e1cf765..3fce0de 100644 --- a/extend/catcher/base/CatchRequest.php +++ b/extend/catcher/base/CatchRequest.php @@ -4,6 +4,7 @@ namespace catcher\base; use app\Request; use catcher\exceptions\FailedException; use catcher\exceptions\ValidateFailedException; +use think\App; class CatchRequest extends Request { @@ -60,9 +61,27 @@ class CatchRequest extends Request // 设置默认参数 if ($this->needCreatorId) { $this->param['creator_id'] = $this->user()->id; - $this->post['creator_id'] = $this->user()->id; } return true; } + + /** + * rewrite post + * + * @time 2020年10月15日 + * @param string $name + * @param null $default + * @param string $filter + * @return array|mixed|null + */ + public function post($name = '', $default = null, $filter = '') + { + if ($this->needCreatorId) { + $this->post['creator_id'] = $this->user()->id; + } + + return parent::post($name, $default, $filter); // TODO: Change the autogenerated stub + } + }