fix: 修复一些主题用户获取节点为空的问题,取消节点API未找到节点的日志记录

This commit is contained in:
xboard 2024-01-15 04:25:25 +08:00
parent 8e57bc4e9b
commit 68d7d64ea7
2 changed files with 3 additions and 4 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\V1\Server; namespace App\Http\Controllers\V1\Server;
use App\Exceptions\ApiException;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Services\ServerService; use App\Services\ServerService;
use App\Services\UserService; use App\Services\UserService;
@ -25,8 +26,7 @@ class UniProxyController extends Controller
$this->nodeType = $request->input('node_type'); $this->nodeType = $request->input('node_type');
$this->nodeInfo = $this->serverService->getServer($this->nodeId, $this->nodeType); $this->nodeInfo = $this->serverService->getServer($this->nodeId, $this->nodeType);
if(!$this->nodeInfo) { if(!$this->nodeInfo) {
Log::channel("daily")->info("$this->nodeId $this->nodeType $this->nodeInfo"); throw new ApiException('server is not exist', 500);
throw new \Exception('server is not exist', 500);
}; };
} }

View File

@ -29,7 +29,6 @@ class ServerController extends Controller
$data = NodeResource::collection($servers); $data = NodeResource::collection($servers);
return response([ return response([
'data' => $data 'data' => $data
])->header('ETag', "\"{$eTag}\"") ])->header('ETag', "\"{$eTag}\"");
->header('Cache-Control', 'public, max-age=3600');
} }
} }