Parcourir la source

feat: 完善jwt失效问题

runphp il y a 1 mois
Parent
commit
880236ea5a
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      src/Auth.php

+ 3 - 3
src/Auth.php

@@ -21,12 +21,12 @@ class Auth implements AuthInterface
 
     private static array $config;
 
-    public function __construct(private readonly UserTypeEnum $userType, private readonly Env $env)
+    public function __construct(private readonly UserTypeEnum $userType)
     {
         if (empty(self::$config)) {
             self::$config = [
-                'jwt_secret' => $this->env->get('JWT_SECRET', ''),
-                'expire_in' => (int) $this->env->get('JWT_EXPIRE_IN', 3600),
+                'jwt_secret' => env('JWT_SECRET', ''),
+                'expire_in' => (int) env('JWT_EXPIRE_IN', 3600),
             ];
         }
     }