mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Request类的post和put方法
This commit is contained in:
@@ -691,7 +691,7 @@ class Request
|
|||||||
if (empty($this->post)) {
|
if (empty($this->post)) {
|
||||||
$content = $this->input;
|
$content = $this->input;
|
||||||
if (empty($_POST) && strpos($content, '":')) {
|
if (empty($_POST) && strpos($content, '":')) {
|
||||||
$this->post = json_decode($content, true);
|
$this->post = (array) json_decode($content, true);
|
||||||
} else {
|
} else {
|
||||||
$this->post = $_POST;
|
$this->post = $_POST;
|
||||||
}
|
}
|
||||||
@@ -716,7 +716,7 @@ class Request
|
|||||||
if (is_null($this->put)) {
|
if (is_null($this->put)) {
|
||||||
$content = $this->input;
|
$content = $this->input;
|
||||||
if (strpos($content, '":')) {
|
if (strpos($content, '":')) {
|
||||||
$this->put = json_decode($content, true);
|
$this->put = (array) json_decode($content, true);
|
||||||
} else {
|
} else {
|
||||||
parse_str($content, $this->put);
|
parse_str($content, $this->put);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user