api pieces-hash keeps return map

This commit is contained in:
xiaomlove
2023-07-30 02:39:45 +08:00
parent 925edf4166
commit 3775f39b6e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ class Handler extends ExceptionHandler
} }
$this->renderable(function (AuthenticationException $e) { $this->renderable(function (AuthenticationException $e) {
return response()->json(fail($e->getMessage(), $e->guards()), 401); return response()->json(fail($e->getMessage(), ['guards' => $e->guards()]), 401);
}); });
$this->renderable(function (UnauthorizedException $e) { $this->renderable(function (UnauthorizedException $e) {
+1 -1
View File
@@ -154,7 +154,7 @@ class TorrentController extends Controller
'pieces_hash' => 'required|array', 'pieces_hash' => 'required|array',
]); ]);
$result = $this->repository->getPiecesHashCache($request->pieces_hash); $result = $this->repository->getPiecesHashCache($request->pieces_hash);
return $this->success($result); return $this->success($result ?: (object)[]);
} }
} }