Browse Source

加长登录过期时间

牟新芬 4 years ago
parent
commit
4213c71c99
1 changed files with 2 additions and 2 deletions
  1. 2 2
      library/traits/JwtAuthModelTrait.php

+ 2 - 2
library/traits/JwtAuthModelTrait.php

@@ -39,7 +39,7 @@ trait JwtAuthModelTrait
             'aud' => $host,
             'aud' => $host,
             'iat' => $time,
             'iat' => $time,
             'nbf' => $time,
             'nbf' => $time,
-            'exp' => strtotime('+ 3hour'),
+            'exp' => strtotime('+1 month'),
         ];
         ];
         $params['jti'] = compact('id', 'type');
         $params['jti'] = compact('id', 'type');
         $token = JWT::encode($params, Env::get('app.app_key', 'default'));
         $token = JWT::encode($params, Env::get('app.app_key', 'default'));
@@ -66,4 +66,4 @@ trait JwtAuthModelTrait
         $model = new self();
         $model = new self();
         return [$model->where($model->getPk(), $data->jti->id)->find(), $data->jti->type];
         return [$model->where($model->getPk(), $data->jti->id)->find(), $data->jti->type];
     }
     }
-}
+}