From 10c9e1801b92a10f7d33e50c537de591fb0bedcc Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Fri, 23 Apr 2021 02:28:47 +0800 Subject: [PATCH] modify --- System/Jwt/Jwt.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index 1bbe41bc..44057e86 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -418,13 +418,13 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= { $model = $this->getUserModel(); if (empty($model)) { - throw new AuthException('授权信息已过期!'); + return (int)$this->addError('授权信息已过期!'); } if (!isset($model['user'])) { - throw new AuthException('授权信息错误!'); + return (int)$this->addError('授权信息错误!'); } if (!$this->check($this->data, (int)$model['user'])) { - throw new AuthException('授权信息不合法!'); + return (int)$this->addError('授权信息不合法!'); } $this->expireRefresh(); @@ -478,13 +478,12 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= /** * @return bool|array - * @throws AuthException * @throws Exception */ private function getUserModel(): bool|array { if (!isset($this->data['token'])) { - throw new AuthException('暂无访问权限!'); + return $this->addError('暂无访问权限!'); } $key = $this->authKey($this->getSource(), $this->data['token']); return $this->getRedis()->hGetAll($key);