改名
This commit is contained in:
@@ -26,12 +26,13 @@ class Annotation extends Component
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $className
|
* @param string $className
|
||||||
|
* @param string $method
|
||||||
* @return array 根据类名获取注解
|
* @return array 根据类名获取注解
|
||||||
* 根据类名获取注解
|
* 根据类名获取注解
|
||||||
*/
|
*/
|
||||||
public function getMethods(string $className): array
|
public function getMethods(string $className, string $method = ''): array
|
||||||
{
|
{
|
||||||
return $this->_loader->getMethod($className);
|
return $this->_loader->getMethod($className, $method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class Middleware
|
|||||||
}
|
}
|
||||||
[$controller, $action] = $node->handler;
|
[$controller, $action] = $node->handler;
|
||||||
$attributes = Snowflake::app()->getAttributes();
|
$attributes = Snowflake::app()->getAttributes();
|
||||||
$annotation = $attributes->getAnnotationByMethod($controller, $action);
|
$annotation = $attributes->getMethods($controller, $action);
|
||||||
if (count($annotation) < 1) {
|
if (count($annotation) < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user