mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: fetch data empty
This commit is contained in:
parent
1a3bc4650e
commit
9ab1cfff9d
@ -7,9 +7,8 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
interface NezhaDataResponse {
|
interface NezhaDataResponse extends NezhaAPISafe {
|
||||||
error?: string;
|
error?: string;
|
||||||
data?: NezhaAPISafe;
|
|
||||||
cause?: string;
|
cause?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ export const dynamic = "force-dynamic";
|
|||||||
|
|
||||||
interface NezhaDataResponse {
|
interface NezhaDataResponse {
|
||||||
error?: string;
|
error?: string;
|
||||||
data?: ServerMonitorChart;
|
|
||||||
cause?: string;
|
cause?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,8 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export const dynamic = "force-dynamic";
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
interface NezhaDataResponse {
|
interface NezhaDataResponse extends ServerApi {
|
||||||
error?: string;
|
error?: string;
|
||||||
data?: ServerApi;
|
|
||||||
cause?: string;
|
cause?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
}
|
}
|
||||||
@ -37,7 +36,7 @@ export const GET = auth(async function GET(req) {
|
|||||||
{ status: 400 },
|
{ status: 400 },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!response.data) {
|
if (!response.result) {
|
||||||
return NextResponse.json({ cause: "fetch data empty" }, { status: 400 });
|
return NextResponse.json({ cause: "fetch data empty" }, { status: 400 });
|
||||||
}
|
}
|
||||||
return NextResponse.json(response, { status: 200 });
|
return NextResponse.json(response, { status: 200 });
|
||||||
|
Loading…
Reference in New Issue
Block a user