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