From aaf854e0463fb718dc3c7ec9c5513eafc96c9c78 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Thu, 14 Mar 2024 15:32:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=91=E7=AE=A1=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0token=E8=BF=87=E6=9C=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/RegulatoryPlatform/regulatoryPlatform.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extend/RegulatoryPlatform/regulatoryPlatform.php b/extend/RegulatoryPlatform/regulatoryPlatform.php index 14ca004..e442155 100644 --- a/extend/RegulatoryPlatform/regulatoryPlatform.php +++ b/extend/RegulatoryPlatform/regulatoryPlatform.php @@ -80,7 +80,14 @@ class regulatoryPlatform throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); } - $this->redis->set("regulatory_platform_access_token", $data['accessToken'], 60 * 60 * 24 * 6); + $expires_in = 60 * 60 * 24 * 6; + if (!empty($data['expiresIn'])) { + if ($data['expiresIn'] > 100){ + $expires_in = $data['expiresIn']; + } + } + + $this->redis->set("regulatory_platform_access_token", $data['accessToken'],$expires_in); return $data['accessToken']; } catch (GuzzleException $e) { @@ -215,7 +222,7 @@ class regulatoryPlatform /** * 请求封装 * @param string $path - * @param array $option + * @param array $arg * @return array * @throws GuzzleException */