From 5f05e0361e2911f30f59d16addb4cd1f515ddc52 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Fri, 11 Apr 2025 16:49:41 +0800 Subject: [PATCH] feat : sts --- app/Service/Admin/Third/AliStsService.php | 2 +- app/Service/Api/System/AliStsService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Service/Admin/Third/AliStsService.php b/app/Service/Admin/Third/AliStsService.php index 80b9ed9..82054bb 100644 --- a/app/Service/Admin/Third/AliStsService.php +++ b/app/Service/Admin/Third/AliStsService.php @@ -96,8 +96,8 @@ class AliStsService extends BaseService $res = $this->getAliStsControls($payload); $this->log->info(__CLASS__.':'.__FUNCTION__.':授权oss信息:'.json_encode($res)); + if (empty($res) || empty($res->body->credentials)) throw new ErrException('授权失败'); $aliResponse = $res->body->credentials; - if (empty($aliResponse)) throw new ErrException('授权失败'); return $this->return->success('success',[ 'access_key_id' => $aliResponse->accessKeyId, diff --git a/app/Service/Api/System/AliStsService.php b/app/Service/Api/System/AliStsService.php index 3136a6d..115c8e7 100644 --- a/app/Service/Api/System/AliStsService.php +++ b/app/Service/Api/System/AliStsService.php @@ -98,8 +98,8 @@ class AliStsService extends BaseService $res = $this->getAliStsControls($payload); $this->log->info(__CLASS__.':'.__FUNCTION__.':授权oss信息:'.json_encode($res)); + if (empty($res) || empty($res->body->credentials)) throw new ErrException('授权失败'); $aliResponse = $res->body->credentials; - if (empty($aliResponse)) throw new ErrException('授权失败'); return $this->return->success('success',[ 'access_key_id' => $aliResponse->accessKeyId,