diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 4d04c240c3..011120402c 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -789,7 +789,8 @@ class baseControl $this->app->setControlFile(); if(!is_array($params)) parse_str($params, $params); - $this->app->setParams(); + $defaultParams = $this->app->getDefaultParams(); + $this->app->params = $this->app->mergeParams($defaultParams, $params); /* * 设置要fetch的方法的参数类型。 diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 79d6a4062d..76f32a3e4e 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1545,13 +1545,13 @@ class baseRouter } /** - * 设置要被调用方法的参数。 - * Set the params of method calling. + * 获取要被调用的方法的参数和类型。 + * Get the default valve and param type of the method calling. * * @access public * @return void */ - public function setParams() + public function getDefaultParams() { try { @@ -1650,6 +1650,26 @@ class baseRouter $defaultParams[$name] = array('default' => $default, 'type' => $type); } + return $defaultParams; + } + catch(EndResponseException $endResponseException) + { + return array(); + } + } + + /** + * 设置要被调用方法的参数。 + * Set the params of method calling. + * + * @access public + * @return void + */ + public function setParams() + { + try + { + $defaultParams = $this->getDefaultParams(); /** * 根据PATH_INFO或者GET方式设置请求的参数。