From 107f77474e0649e4dd4e9a39bd94abeba53908df Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 22 Aug 2016 18:11:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BBparam?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E4=BC=98=E5=85=88=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=20=E8=B7=AF=E7=94=B1=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=BC=98=E5=85=88=20=E8=B7=AF=E7=94=B1=E8=A7=84=E5=88=99?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=A2=9D=E5=A4=96=E5=8F=82=E6=95=B0=E7=BA=B3?= =?UTF-8?q?=E5=85=A5=20=E8=B7=AF=E7=94=B1=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 2 +- library/think/Route.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 4d98c1e7..4ce56a50 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -617,7 +617,7 @@ class Request $vars = []; } // 当前请求参数和URL地址中的参数合并 - $this->param = array_merge($this->route(false), $this->get(false), $vars); + $this->param = array_merge($this->get(false), $vars, $this->route(false)); } if (true === $name) { // 获取包含文件上传信息的数组 diff --git a/library/think/Route.php b/library/think/Route.php index 19282e8a..76d06a74 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1385,7 +1385,8 @@ class Route // 操作方法前缀支持 $action = 0 !== strpos($action, self::$methodPrefix[$method]) ? self::$methodPrefix[$method] . $action : $action; } - $_GET = array_merge($_GET, $var); + // 设置当前请求的路由变量 + Request::instance()->route($var); // 路由到模块/控制器/操作 return ['type' => 'module', 'module' => [$module, $controller, $action], 'convert' => false]; }