Parcourir la source

Merge branch 'v1.3' of http://161.248.87.190:3000/bcwin/site_front into v1.3

XianCH il y a 3 mois
Parent
commit
17584c326f
1 fichiers modifiés avec 12 ajouts et 1 suppressions
  1. 12 1
      src/hooks/useGame.tsx

+ 12 - 1
src/hooks/useGame.tsx

@@ -42,8 +42,11 @@ const useGame = () => {
                 Toast.clear();
                 if (res.data && res.data.game_url) {
                     eventStartTrial();
-
                     const game_url = res.data.game_url;
+
+                    // 获取游戏的品牌
+                    const category_name = game?.category_name;
+
                     // 然后是文档对象
                     if (game_url.indexOf("!doctype") !== -1) {
                         sessionStorage.setItem("game_url", res.data.game_url);
@@ -52,6 +55,14 @@ const useGame = () => {
                         return;
                     }
                     const url = `${encodeURI(res.data.game_url)}&return_url=${encodeURI(window.location.href.replace(pathname, ""))}&category_name=${game.provider}`;
+
+                    // 如果是pp游戏,则当前窗口打开新的地址,不需要加return_url
+                    if(category_name === 'PP'){
+                      const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
+                      window.open(ppUrl,'_self');
+                      return
+                    }
+
                     if (new RegExp("https").test(game_url)) {
                         // 如果是https
                         router.push(`/game?${url}`);