From 6883352250af94c3def700e4a92d8f7ed51fec43 Mon Sep 17 00:00:00 2001
From: colly_wyx <wangyixiong_007@163.com>
Date: Tue, 24 Apr 2018 10:02:50 +0800
Subject: [PATCH] 优化api框架
---
PhalApi/PhalApi/Request.php | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/PhalApi/PhalApi/Request.php b/PhalApi/PhalApi/Request.php
index 052b928..ad9ffca 100644
--- a/PhalApi/PhalApi/Request.php
+++ b/PhalApi/PhalApi/Request.php
@@ -83,7 +83,7 @@
// ���������������
$this->headers = $this->getAllHeaders();
$this->get = $_GET;
- $this->post = $_POST;
+ $this->post = !empty($_POST)?$_POST:file_get_contents('php://input');
$this->request = $_REQUEST;
$this->cookie = $_COOKIE;
@@ -177,6 +177,8 @@
? $this->getDataBySource($rule['source'])
: $this->data;
+ DI()->logger->error('test', $_POST);
+
$rs = PhalApi_Request_Var::format($rule['name'], $rule, $data);
if ($rs === NULL && (isset($rule['require']) && $rule['require'])) {
--
Gitblit v1.8.0