xiaolin.fu 1 year ago
parent
commit
c79a631749
1 changed files with 2 additions and 2 deletions
  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();