| 123456789101112131415161718192021222324252627282930313233343536 |
- 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<any>({
- 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 }
- );
- }
- }
|