From 8c2bc2073bec19feacc9adaea484dd365a4e9bcc Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Sun, 14 Jan 2018 02:21:30 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BC=98=E5=8C=96ThinkPHP=E7=9A=84?= =?UTF-8?q?=E6=A0=B8=E5=BF=83=E7=B1=BB=E5=BA=93=EF=BC=8C=E6=8F=90=E5=8D=87?= =?UTF-8?q?POST=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/behavior/RequestFilter.php | 1 - thinkphp/library/think/Request.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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)) {