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]; }