import { NextResponse } from "next/server"; import { restApiFetch } from "@/utils/bagisto"; export async function GET() { try { // const { id } = await params; // 解包拿到订单ID const apiUrl = `/home`; console.log("最终请求API地址:", apiUrl); const response = await restApiFetch({ api: apiUrl, method: "GET", cache: "no-store", }); return NextResponse.json(response.body,{ status: response.status, }); } catch (error) { return NextResponse.json( { message: "Network error", error: error instanceof Error ? error.message : error, }, { status: 500 } ); } }