改名
This commit is contained in:
+10
-12
@@ -575,27 +575,25 @@ class Node extends HttpService
|
|||||||
*/
|
*/
|
||||||
private function httpFilter(): mixed
|
private function httpFilter(): mixed
|
||||||
{
|
{
|
||||||
if (!is_array($this->handler)) {
|
|
||||||
return $this->runWith(...func_get_args());
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
[$class, $method] = $this->handler;
|
if (!is_array($this->handler)) {
|
||||||
|
return $this->runWith(...func_get_args());
|
||||||
|
}
|
||||||
/** @var HttpFilter $filter */
|
/** @var HttpFilter $filter */
|
||||||
$filter = Snowflake::app()->get('filter');
|
$filter = Snowflake::app()->get('filter');
|
||||||
$validator = $filter->check(get_class($class), $method);
|
$validator = $filter->check(get_class($this->handler[0]), $this->handler[1]);
|
||||||
if ($validator instanceof Validator && !$validator->validation()) {
|
if (!($validator instanceof Validator)) {
|
||||||
response()->statusCode = 401;
|
return $this->runWith(...func_get_args());
|
||||||
|
}
|
||||||
|
if (!$validator->validation()) {
|
||||||
|
var_dump($validator->getError());
|
||||||
return Json::to(401, $validator->getError());
|
return Json::to(401, $validator->getError());
|
||||||
}
|
}
|
||||||
|
return $this->runWith(...func_get_args());
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
$this->error($throwable->getMessage());
|
$this->error($throwable->getMessage());
|
||||||
return Json::to(401, $throwable->getMessage());
|
return Json::to(401, $throwable->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->runWith(...func_get_args());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user