From 39872d5aac8e25508c3738efe043e7a970e02e92 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Wed, 4 Jun 2025 17:45:17 +0800 Subject: [PATCH] =?UTF-8?q?API=20=E5=82=B3=E6=AA=94=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=E9=82=8F=E8=BC=AF=2020250604?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/ApiClient.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Services/ApiClient.php b/app/Services/ApiClient.php index 5e94a44..3bee70c 100644 --- a/app/Services/ApiClient.php +++ b/app/Services/ApiClient.php @@ -171,10 +171,11 @@ class ApiClient public function upload(string $endpoint, array $files = [], array $data = []) { + $this->setTimeout(300); + $this->setConnectTimeout(10); return $this->requestWithCatch(function () use ($endpoint, $files, $data) { - $request = $this->timeout(300) - ->connectTimeout(300) - ->withDefaultHeaders(); + $request = $this->withDefaultHeaders(); + foreach ($files as $key => $filePath) { $filename = basename($filePath); $request = $request->attach($key, fopen($filePath, 'r'), $filename);