wesmiler 2 月之前
父節點
當前提交
9e7f50c631
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/Services/JwtService.php

+ 1 - 1
app/Services/JwtService.php

@@ -34,7 +34,7 @@ class JwtService extends BaseService
             "iat" => time(),
             "iat" => time(),
             "nbf" => time(),
             "nbf" => time(),
             "exp" => time() + ($ttl?$ttl:env('JWT_TTL',3600)),  // 有效期
             "exp" => time() + ($ttl?$ttl:env('JWT_TTL',3600)),  // 有效期
-            "data" => $data
+            "data" => trim($data)
         );
         );
         return JWT::encode($payload, env('JWT_KEY'), $this->alg);
         return JWT::encode($payload, env('JWT_KEY'), $this->alg);
     }
     }