This commit is contained in:
2020-09-03 17:37:53 +08:00
parent 158973c6be
commit ab0ea0c649
+7 -6
View File
@@ -59,7 +59,7 @@ class Node extends Application
} else { } else {
$this->handler = $handler; $this->handler = $handler;
} }
return $this->newExec(); return $this->restructure();
} }
@@ -288,20 +288,21 @@ class Node extends Application
return; return;
} }
$this->middleware = $this->each($middles, $_tmp); $this->middleware = $this->each($middles, $_tmp);
$this->newExec(); $this->restructure();
} }
/** /**
* @throws Exception * @throws Exception
*/ */
private function newExec() private function restructure()
{ {
if (!empty($this->handler)) { if (empty($this->handler)) {
$made = new Middleware(); return $this;
}
$made = Snowflake::createObject(Middleware::class);
$made->setMiddleWares($this->middleware); $made->setMiddleWares($this->middleware);
$made->getGenerate($this); $made->getGenerate($this);
}
return $this; return $this;
} }