改名
This commit is contained in:
@@ -41,9 +41,6 @@ class Node extends HttpService
|
|||||||
|
|
||||||
private string $_error = '';
|
private string $_error = '';
|
||||||
|
|
||||||
private array $rules = [];
|
|
||||||
|
|
||||||
|
|
||||||
private string $_dataType = '';
|
private string $_dataType = '';
|
||||||
|
|
||||||
/** @var ?Closure|?array */
|
/** @var ?Closure|?array */
|
||||||
@@ -358,7 +355,7 @@ class Node extends HttpService
|
|||||||
{
|
{
|
||||||
$annotation = annotation()->getMethods($className, $action);
|
$annotation = annotation()->getMethods($className, $action);
|
||||||
if (empty($annotation)) {
|
if (empty($annotation)) {
|
||||||
return $this->injectRules($className, $action);
|
return $this;
|
||||||
}
|
}
|
||||||
foreach ($annotation as $attribute) {
|
foreach ($annotation as $attribute) {
|
||||||
if ($attribute instanceof Interceptor) {
|
if ($attribute instanceof Interceptor) {
|
||||||
@@ -374,22 +371,6 @@ class Node extends HttpService
|
|||||||
$this->addLimits($attribute->limits);
|
$this->addLimits($attribute->limits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->injectRules($className, $action);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $controller
|
|
||||||
* @param string $action
|
|
||||||
* @return $this
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
private function injectRules(string $controller, string $action): static
|
|
||||||
{
|
|
||||||
/** @var HttpFilter $filter */
|
|
||||||
$filter = Snowflake::app()->get('filter');
|
|
||||||
$this->rules = $filter->getRules($controller, $action);
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -460,6 +441,7 @@ class Node extends HttpService
|
|||||||
/**
|
/**
|
||||||
* @param string $search
|
* @param string $search
|
||||||
* @return Node|null
|
* @return Node|null
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function findNode(string $search): ?Node
|
public function findNode(string $search): ?Node
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user