diff --git a/application/api/behavior/RequestFilter.php b/application/api/behavior/RequestFilter.php index e72d0c6..071cd11 100644 --- a/application/api/behavior/RequestFilter.php +++ b/application/api/behavior/RequestFilter.php @@ -21,7 +21,6 @@ class RequestFilter { /** * 默认行为函数 * @author zhaoxiang - * @return \think\Request * @throws \think\exception\DbException */ public function run() { diff --git a/thinkphp/library/think/Request.php b/thinkphp/library/think/Request.php index 5f05b91..47f4ac8 100644 --- a/thinkphp/library/think/Request.php +++ b/thinkphp/library/think/Request.php @@ -692,10 +692,10 @@ class Request { if (empty($this->post)) { $content = $this->input; - if (empty($_POST) && false !== strpos($this->contentType(), 'application/json')) { - $this->post = (array) json_decode($content, true); - } else { + if(false !== strpos($this->contentType(), 'multipart/form-data')) { $this->post = $_POST; + } else { + $this->post = (array) json_decode($content, true); } } if (is_array($name)) {