Selaa lähdekoodia

游戏跳转链接language语言br改成pt

zcj03 6 kuukautta sitten
vanhempi
commit
8f7de964d2
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      src/hooks/useGame.tsx

+ 4 - 2
src/hooks/useGame.tsx

@@ -1,6 +1,7 @@
 import { GameListRep, GameRequest, getGameDetailApi } from "@/api/home";
-import { useRouter } from "@/i18n/routing";
+import { useRouter, defaultLocale } from "@/i18n/routing";
 import { brandList } from "@/utils/constant";
+import { getCookies } from "@/utils/Cookies";
 import { Toast } from "antd-mobile";
 import { useTranslations } from "next-intl";
 // 地址白名单
@@ -15,7 +16,8 @@ const useGame = () => {
             maskStyle: { zIndex: 99999, background: "rgba(0,0,0,0.5)" },
         });
         const brand = brandList.find((item) => item.gid === game.game_id)?.brand ?? "";
-        getGameDetailApi(params)
+        const lang = getCookies("language") || defaultLocale;
+        getGameDetailApi({...params, language: lang === 'br' ? 'pt' : lang})
             .then((res) => {
                 Toast.clear();
                 if (res.data && res.data.game_url) {