From 6a52db4cfc81f516f50611b8944fea35aba9ed6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 19 Mar 2021 19:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Route/Router.php | 1 - System/Jwt/Jwt.php | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index e0db3641..1ea9f6e4 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -10,7 +10,6 @@ use HttpServer\Http\Request; use HttpServer\IInterface\RouterInterface; use JetBrains\PhpStorm\Pure; -use ReflectionException; use Snowflake\Abstracts\Config; use Snowflake\Core\Json; use Snowflake\Exception\ComponentException; diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index cd98b901..f13cecbd 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -458,10 +458,18 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= } /** + * @param null $token + * @param null $source * @throws Exception */ - private function expireRefresh() + public function expireRefresh($token = null, $source = null) { + if (!empty($token)) { + $this->data['token'] = $token; + } + if (!empty($source)) { + $this->data['source'] = $source; + } $key = $this->authKey($this->getSource(), $this->data['token']); $this->getRedis()->expire($key, $this->timeout); }