modify
This commit is contained in:
+4
-5
@@ -418,13 +418,13 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
|
|||||||
{
|
{
|
||||||
$model = $this->getUserModel();
|
$model = $this->getUserModel();
|
||||||
if (empty($model)) {
|
if (empty($model)) {
|
||||||
throw new AuthException('授权信息已过期!');
|
return (int)$this->addError('授权信息已过期!');
|
||||||
}
|
}
|
||||||
if (!isset($model['user'])) {
|
if (!isset($model['user'])) {
|
||||||
throw new AuthException('授权信息错误!');
|
return (int)$this->addError('授权信息错误!');
|
||||||
}
|
}
|
||||||
if (!$this->check($this->data, (int)$model['user'])) {
|
if (!$this->check($this->data, (int)$model['user'])) {
|
||||||
throw new AuthException('授权信息不合法!');
|
return (int)$this->addError('授权信息不合法!');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->expireRefresh();
|
$this->expireRefresh();
|
||||||
@@ -478,13 +478,12 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool|array
|
* @return bool|array
|
||||||
* @throws AuthException
|
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function getUserModel(): bool|array
|
private function getUserModel(): bool|array
|
||||||
{
|
{
|
||||||
if (!isset($this->data['token'])) {
|
if (!isset($this->data['token'])) {
|
||||||
throw new AuthException('暂无访问权限!');
|
return $this->addError('暂无访问权限!');
|
||||||
}
|
}
|
||||||
$key = $this->authKey($this->getSource(), $this->data['token']);
|
$key = $this->authKey($this->getSource(), $this->data['token']);
|
||||||
return $this->getRedis()->hGetAll($key);
|
return $this->getRedis()->hGetAll($key);
|
||||||
|
|||||||
Reference in New Issue
Block a user