改名
This commit is contained in:
@@ -49,9 +49,11 @@ class OnRequest extends Callback
|
|||||||
} catch (Error | \Throwable $exception) {
|
} catch (Error | \Throwable $exception) {
|
||||||
$params = $this->sendErrorMessage($sResponse ?? null, $exception, $response);
|
$params = $this->sendErrorMessage($sResponse ?? null, $exception, $response);
|
||||||
} finally {
|
} finally {
|
||||||
unset($sResponse, $response);
|
|
||||||
Context::deleteId('response');
|
|
||||||
$events = Snowflake::app()->getEvent();
|
$events = Snowflake::app()->getEvent();
|
||||||
|
if (!$events->exists(Event::EVENT_AFTER_REQUEST)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$sRequest = $sRequest ?? null;
|
||||||
$events->trigger(Event::EVENT_AFTER_REQUEST, [$sRequest, $params]);
|
$events->trigger(Event::EVENT_AFTER_REQUEST, [$sRequest, $params]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -379,13 +379,13 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
|
|||||||
$this->data = request()->headers->getHeaders();
|
$this->data = request()->headers->getHeaders();
|
||||||
$model = $this->getUserModel();
|
$model = $this->getUserModel();
|
||||||
if (empty($model)) {
|
if (empty($model)) {
|
||||||
throw new AuthException('授权信息已过期!');
|
return $this->addError('授权信息已过期!');
|
||||||
}
|
}
|
||||||
if (!isset($model['user'])) {
|
if (!isset($model['user'])) {
|
||||||
throw new AuthException('授权信息错误!');
|
return $this->addError('授权信息错误!');
|
||||||
}
|
}
|
||||||
if (!$this->check($this->data, $model['user'])) {
|
if (!$this->check($this->data, $model['user'])) {
|
||||||
throw new AuthException('授权信息不合法!');
|
return $this->addError('授权信息不合法!');
|
||||||
}
|
}
|
||||||
$this->expireRefresh();
|
$this->expireRefresh();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user