This commit is contained in:
2021-03-04 00:20:21 +08:00
parent ee4436eab4
commit 54045e6bae
3 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -25,14 +25,16 @@ use Snowflake\Snowflake;
if (is_string($this->middleware)) {
$this->middleware = [$this->middleware];
}
$array = [];
foreach ($this->middleware as $key => $value) {
$sn = Snowflake::createObject($value);
if (!($sn instanceof \HttpServer\IInterface\Middleware)) {
continue;
}
$this->middleware[$key] = [$sn, 'onHandler'];
$array[] = [$sn, 'onHandler'];
}
$this->middleware = $array;
}
-1
View File
@@ -76,7 +76,6 @@ class Middleware
if (empty($annotation)) {
return;
}
var_dump($annotation, $action);
foreach ($annotation as $name => $_attribute) {
foreach ($_attribute as $attribute) {
if ($attribute instanceof Interceptor) {
+1
View File
@@ -405,6 +405,7 @@ class Node extends HttpService
$class = [$class];
}
foreach ($class as $closure) {
var_dump($closure);
if (in_array($closure, $this->middleware)) {
continue;
}