소스 검색

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

zcj03 6 달 전
부모
커밋
8f7de964d2
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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) {