year 1 kuukausi sitten
vanhempi
commit
f508234958
1 muutettua tiedostoa jossa 10 lisäystä ja 8 poistoa
  1. 10 8
      src/app/[locale]/(TabBar)/gameList/[[...gameListFlag]]/page.tsx

+ 10 - 8
src/app/[locale]/(TabBar)/gameList/[[...gameListFlag]]/page.tsx

@@ -43,23 +43,25 @@ const GameListFlag: FC<Props> = (props) => {
         page_size: 15,
         use_page: true,
     });
-    // 通过类型判断, 1: 游戏 2:厂商
-    if (+searchParams.type === 2) {
-        params.current.provider_id = +searchParams.gameListFlag;
-    } else {
-        params.current.category_id = +searchParams.gameListFlag;
-    }
+
     const getGames = async (): Promise<GameListRep[] | undefined> => {
         let res: any;
 
         if (pageType === PageType.Default || !pageType) {
+            // 通过类型判断, 1: 游戏 2:厂商
+            if (+searchParams.type === 2) {
+                params.current.provider_id = +searchParams.gameListFlag;
+            } else {
+                params.current.category_id = +searchParams.gameListFlag;
+            }
             res = await searchGameListApi(params.current);
         }
+
         if (Number(pageType) === PageType.History) {
-            res = await getGameHistory(params as any);
+            res = await getGameHistory(params.current as any);
         }
         if (Number(pageType) === PageType.Favorite) {
-            res = await getFavoriteList(params as any);
+            res = await getFavoriteList(params.current as any);
         }
 
         if (res?.code === 200) {