|
@@ -39,7 +39,7 @@ const useGame = () => {
|
|
|
const lang = getCookies("language") || defaultLocale;
|
|
|
getGameDetailApi({ ...params, language: lang === "br" ? "pt" : lang })
|
|
|
.then((res) => {
|
|
|
- console.log('category_name',game)
|
|
|
+ console.log("category_name", game);
|
|
|
|
|
|
Toast.clear();
|
|
|
if (res.data && res.data.game_url) {
|
|
@@ -47,7 +47,7 @@ const useGame = () => {
|
|
|
const game_url = res.data.game_url;
|
|
|
|
|
|
// 获取游戏的品牌
|
|
|
- const gameId= game?.game_id || '';
|
|
|
+ const gameId = game?.game_id || "";
|
|
|
|
|
|
// 然后是文档对象
|
|
|
if (game_url.indexOf("!doctype") !== -1) {
|
|
@@ -60,11 +60,13 @@ const useGame = () => {
|
|
|
|
|
|
// 如果是pp游戏,则当前窗口打开新的地址,不需要加return_url
|
|
|
// gid 如果开头是1的6位数的数字,则认为是pp游戏
|
|
|
- let isPP = /^1\d{5}$/.test(gameId)
|
|
|
- if(!!isPP){
|
|
|
- // const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
|
|
|
- window.open(url,'_self');
|
|
|
- return
|
|
|
+ let isPP = /^1\d{5}$/.test(gameId);
|
|
|
+ // 如果是play游戏,则当前窗口打开新的地址
|
|
|
+ const isPlay = /^5\d{5}$/.test(gameId);
|
|
|
+ if (isPP || isPlay) {
|
|
|
+ // const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
|
|
|
+ window.open(url, "_self");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
if (new RegExp("https").test(game_url)) {
|