mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进Request类method方法
This commit is contained in:
@@ -408,7 +408,7 @@ class Request
|
|||||||
/**
|
/**
|
||||||
* 当前的请求类型
|
* 当前的请求类型
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $method 请求类型
|
* @param bool $method true 获取原始请求类型
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function method($method = '')
|
public function method($method = '')
|
||||||
@@ -416,9 +416,6 @@ class Request
|
|||||||
if (true === $method) {
|
if (true === $method) {
|
||||||
// 获取原始请求类型
|
// 获取原始请求类型
|
||||||
return IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']);
|
return IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']);
|
||||||
} elseif ($method) {
|
|
||||||
$this->method = $method;
|
|
||||||
return;
|
|
||||||
} elseif (!$this->method) {
|
} elseif (!$this->method) {
|
||||||
if (isset($_POST[Config::get('var_method')])) {
|
if (isset($_POST[Config::get('var_method')])) {
|
||||||
$this->method = strtoupper($_POST[Config::get('var_method')]);
|
$this->method = strtoupper($_POST[Config::get('var_method')]);
|
||||||
|
|||||||
Reference in New Issue
Block a user