From bedeff5accafb9a8424f64e89f2862e6990868d3 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Mon, 3 May 2021 13:47:56 +0800 Subject: [PATCH] modify --- System/Jwt/Jwt.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index 5b3589eb..9d4b7ac8 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -136,14 +136,9 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= } else if ($headers instanceof HttpHeaders) { $headers = $headers->getHeaders(); } - $this->data = $headers; - if (empty($unionId)) { - throw new AuthException('您还未登录或已登录超时'); - } - $source = $header['source'] ?? 'browser'; - if (empty($source) || !in_array($source, $this->source)) { - throw new Exception('未知的登录设备'); + if (!isset($this->data['source'])) { + $this->data['source'] = 'browser'; } return $this->createEncrypt($unionId); } @@ -177,7 +172,6 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= foreach ($caches as $cache) { $redis->del($cache); } - return $refresh; } @@ -279,9 +273,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= { $source = $this->getSource(); if (!empty($_source)) $source = $_source; - if (empty($source)) { - throw new AuthException("未知的登陆设备"); - } + return 'Tmp_Token:' . strtoupper($source) . ':' . $token; }