|
@@ -23,8 +23,10 @@ const useGame = () => {
|
|
|
Toast.clear();
|
|
|
if (res.data && res.data.game_url) {
|
|
|
const game_url = res.data.game_url;
|
|
|
- //
|
|
|
- console.log(`🚀🚀🚀🚀🚀-> in useGame.tsx on 28`);
|
|
|
+ // 获取游戏的品牌
|
|
|
+ const category_name = game?.category_name;
|
|
|
+ console.log(`🚀🚀🚀🚀🚀-> in useGame.tsx on 28`,game,res.data);
|
|
|
+
|
|
|
// 然后是文档对象
|
|
|
if (game_url.indexOf("!doctype") !== -1) {
|
|
|
sessionStorage.setItem("game_url", res.data.game_url);
|
|
@@ -33,6 +35,14 @@ const useGame = () => {
|
|
|
return;
|
|
|
}
|
|
|
const url = `${encodeURI(res.data.game_url)}&brand=${brand}&return_url=${window.location.href.replace(pathname, "")}&category_name=${game.provider}`;
|
|
|
+
|
|
|
+ // 如果是pp游戏,在当前页面打开游戏地址,不需要新窗口打开,不需要return_url
|
|
|
+ if(brand === 'pp'){
|
|
|
+ const ppUrl = `${encodeURI(res.data.game_url)}&brand=${brand}&category_name=${game.provider}`;
|
|
|
+ window.open(ppUrl,'_self');
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (new RegExp("https").test(game_url)) {
|
|
|
// 如果是https
|
|
|
router.push(`/game?${url}`);
|