From 68d7d64ea75408a602a86da5362fae3c530b01bc Mon Sep 17 00:00:00 2001 From: xboard Date: Mon, 15 Jan 2024 04:25:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=94=A8=E6=88=B7=E8=8E=B7=E5=8F=96=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=8A=82=E7=82=B9API=E6=9C=AA=E6=89=BE?= =?UTF-8?q?=E5=88=B0=E8=8A=82=E7=82=B9=E7=9A=84=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/V1/Server/UniProxyController.php | 4 ++-- app/Http/Controllers/V1/User/ServerController.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/V1/Server/UniProxyController.php b/app/Http/Controllers/V1/Server/UniProxyController.php index 8a132fc..2a52534 100644 --- a/app/Http/Controllers/V1/Server/UniProxyController.php +++ b/app/Http/Controllers/V1/Server/UniProxyController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\V1\Server; +use App\Exceptions\ApiException; use App\Http\Controllers\Controller; use App\Services\ServerService; use App\Services\UserService; @@ -25,8 +26,7 @@ class UniProxyController extends Controller $this->nodeType = $request->input('node_type'); $this->nodeInfo = $this->serverService->getServer($this->nodeId, $this->nodeType); if(!$this->nodeInfo) { - Log::channel("daily")->info("$this->nodeId $this->nodeType $this->nodeInfo"); - throw new \Exception('server is not exist', 500); + throw new ApiException('server is not exist', 500); }; } diff --git a/app/Http/Controllers/V1/User/ServerController.php b/app/Http/Controllers/V1/User/ServerController.php index 2260a35..ffeec83 100644 --- a/app/Http/Controllers/V1/User/ServerController.php +++ b/app/Http/Controllers/V1/User/ServerController.php @@ -29,7 +29,6 @@ class ServerController extends Controller $data = NodeResource::collection($servers); return response([ 'data' => $data - ])->header('ETag', "\"{$eTag}\"") - ->header('Cache-Control', 'public, max-age=3600'); + ])->header('ETag', "\"{$eTag}\""); } }