改进Rest控制器

This commit is contained in:
thinkphp
2016-07-19 11:29:13 +08:00
parent b6c81b2b78
commit 382e6a1f29
2 changed files with 4 additions and 5 deletions

View File

@@ -338,8 +338,7 @@ class App
// 操作不存在
if (method_exists($instance, '_empty')) {
$reflect = new \ReflectionMethod($instance, '_empty');
$args = self::bindParams($reflect, Request::instance()->param());
$data = $reflect->invokeArgs($instance, [$action, $args]);
$data = $reflect->invokeArgs($instance, [$action]);
self::$debug && Log::record('[ RUN ] ' . $reflect->__toString(), 'info');
} else {
throw new HttpException(404, 'method not exists:' . (new \ReflectionClass($instance))->getName() . '->' . $action);