mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
修正Request类
This commit is contained in:
@@ -413,7 +413,10 @@ class Request
|
|||||||
*/
|
*/
|
||||||
public function method($method = '')
|
public function method($method = '')
|
||||||
{
|
{
|
||||||
if ($method) {
|
if (true === $method) {
|
||||||
|
// 获取原始请求类型
|
||||||
|
return IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']);
|
||||||
|
} elseif ($method) {
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
return;
|
return;
|
||||||
} elseif (!$this->method) {
|
} elseif (!$this->method) {
|
||||||
@@ -497,7 +500,7 @@ class Request
|
|||||||
public function param($name = '', $default = null)
|
public function param($name = '', $default = null)
|
||||||
{
|
{
|
||||||
if (empty($this->param)) {
|
if (empty($this->param)) {
|
||||||
$method = $this->method();
|
$method = $this->method(true);
|
||||||
// 自动获取请求变量
|
// 自动获取请求变量
|
||||||
switch ($method) {
|
switch ($method) {
|
||||||
case 'POST':
|
case 'POST':
|
||||||
|
|||||||
Reference in New Issue
Block a user