xiaolin.fu 1 年之前
父節點
當前提交
c79a631749
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/app/[locale]/page.tsx

+ 2 - 2
src/app/[locale]/page.tsx

@@ -15,8 +15,8 @@ const getGames = async (): Promise<GroupType[]> => {
     const data = await fetch(`${BASE_URL}/v1/api/front/game_list`, {
         method: "POST",
         body: JSON.stringify({}),
-    }).then((res) => res.json());
-    return data.data;
+    }).then((res) => res.json()).catch((err) => console.error(err));
+    return data?.data || [];
 };
 export default async function Page() {
     const group: GroupType[] = await getGames();