mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
fixed 优化ThinkPHP的核心类库,提升POST数据获取成功率
This commit is contained in:
parent
7c3a9d8742
commit
8c2bc2073b
@ -21,7 +21,6 @@ class RequestFilter {
|
|||||||
/**
|
/**
|
||||||
* 默认行为函数
|
* 默认行为函数
|
||||||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||||
* @return \think\Request
|
|
||||||
* @throws \think\exception\DbException
|
* @throws \think\exception\DbException
|
||||||
*/
|
*/
|
||||||
public function run() {
|
public function run() {
|
||||||
|
@ -692,10 +692,10 @@ class Request
|
|||||||
{
|
{
|
||||||
if (empty($this->post)) {
|
if (empty($this->post)) {
|
||||||
$content = $this->input;
|
$content = $this->input;
|
||||||
if (empty($_POST) && false !== strpos($this->contentType(), 'application/json')) {
|
if(false !== strpos($this->contentType(), 'multipart/form-data')) {
|
||||||
$this->post = (array) json_decode($content, true);
|
|
||||||
} else {
|
|
||||||
$this->post = $_POST;
|
$this->post = $_POST;
|
||||||
|
} else {
|
||||||
|
$this->post = (array) json_decode($content, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($name)) {
|
if (is_array($name)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user