改名
This commit is contained in:
@@ -25,14 +25,16 @@ use Snowflake\Snowflake;
|
|||||||
if (is_string($this->middleware)) {
|
if (is_string($this->middleware)) {
|
||||||
$this->middleware = [$this->middleware];
|
$this->middleware = [$this->middleware];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$array = [];
|
||||||
foreach ($this->middleware as $key => $value) {
|
foreach ($this->middleware as $key => $value) {
|
||||||
$sn = Snowflake::createObject($value);
|
$sn = Snowflake::createObject($value);
|
||||||
|
|
||||||
if (!($sn instanceof \HttpServer\IInterface\Middleware)) {
|
if (!($sn instanceof \HttpServer\IInterface\Middleware)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$this->middleware[$key] = [$sn, 'onHandler'];
|
$array[] = [$sn, 'onHandler'];
|
||||||
}
|
}
|
||||||
|
$this->middleware = $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ class Middleware
|
|||||||
if (empty($annotation)) {
|
if (empty($annotation)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var_dump($annotation, $action);
|
|
||||||
foreach ($annotation as $name => $_attribute) {
|
foreach ($annotation as $name => $_attribute) {
|
||||||
foreach ($_attribute as $attribute) {
|
foreach ($_attribute as $attribute) {
|
||||||
if ($attribute instanceof Interceptor) {
|
if ($attribute instanceof Interceptor) {
|
||||||
|
|||||||
@@ -405,6 +405,7 @@ class Node extends HttpService
|
|||||||
$class = [$class];
|
$class = [$class];
|
||||||
}
|
}
|
||||||
foreach ($class as $closure) {
|
foreach ($class as $closure) {
|
||||||
|
var_dump($closure);
|
||||||
if (in_array($closure, $this->middleware)) {
|
if (in_array($closure, $this->middleware)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user