From c095b69f67e0a45afee0427d476d726732e06b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 9 Jul 2021 10:41:31 +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 --- System/Jwt/Jwt.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index 62b8b0ae..28434fa5 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -8,6 +8,7 @@ use HttpServer\Http\HttpHeaders; use Snowflake\Abstracts\Component; use Snowflake\Abstracts\Config; use Snowflake\Cache\Redis; +use Snowflake\Core\Json; use Snowflake\Core\Str; use Snowflake\Exception\AuthException; use Snowflake\Exception\ConfigException; @@ -234,6 +235,9 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= if (!openssl_public_decrypt(base64_decode($headers['refresh']), $data, $this->public)) { throw new AuthException('信息解码失败.'); } + + $data = Json::decode($data, true); + return (int)$data['user']; }