mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: docker fetch error log
This commit is contained in:
parent
3e9a6e1eef
commit
fac484bc45
@ -11,6 +11,7 @@ interface NezhaDataResponse {
|
||||
error?: string;
|
||||
data?: ServerApi;
|
||||
cause?: string;
|
||||
code?: string;
|
||||
}
|
||||
|
||||
export const GET = auth(async function GET(req) {
|
||||
@ -28,5 +29,14 @@ export const GET = auth(async function GET(req) {
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
if (response.code === "ConnectionRefused") {
|
||||
return NextResponse.json(
|
||||
{ cause: "server connect error" },
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
if (!response.data) {
|
||||
return NextResponse.json({ cause: "fetch data empty" }, { status: 400 });
|
||||
}
|
||||
return NextResponse.json(response, { status: 200 });
|
||||
});
|
||||
|
@ -75,7 +75,7 @@ export async function GetNezhaData() {
|
||||
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.log("GetServerDetail error:", error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user