refactor: 修改鉴权中单件

This commit is contained in:
2025-02-10 17:15:19 +08:00
parent d5ae950365
commit c6c252c06a

View File

@@ -67,6 +67,8 @@ class Auth extends \thans\jwt\middleware\BaseMiddleware
return $this->setAuthentication($response, $token); return $this->setAuthentication($response, $token);
} catch (\thans\jwt\exception\TokenBlacklistGracePeriodException $e) { } catch (\thans\jwt\exception\TokenBlacklistGracePeriodException $e) {
return error('登录已过期', [], 401); return error('登录已过期', [], 401);
} catch (\Throwable $th) {
return error('请登录', [], 401);
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {
return error('请先登录', [], 401); return error('请先登录', [], 401);