|
@@ -39,13 +39,17 @@ const useGame = () => {
|
|
const lang = getCookies("language") || defaultLocale;
|
|
const lang = getCookies("language") || defaultLocale;
|
|
getGameDetailApi({ ...params, language: lang === "br" ? "pt" : lang })
|
|
getGameDetailApi({ ...params, language: lang === "br" ? "pt" : lang })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
|
+ console.log('category_name',game)
|
|
|
|
+
|
|
Toast.clear();
|
|
Toast.clear();
|
|
if (res.data && res.data.game_url) {
|
|
if (res.data && res.data.game_url) {
|
|
eventStartTrial();
|
|
eventStartTrial();
|
|
const game_url = res.data.game_url;
|
|
const game_url = res.data.game_url;
|
|
|
|
|
|
// 获取游戏的品牌
|
|
// 获取游戏的品牌
|
|
- const category_name = game?.category_name;
|
|
|
|
|
|
+ const categoryName:any = game?.category_name;
|
|
|
|
+
|
|
|
|
+ console.log('category_name222',game,categoryName.toLowerCase())
|
|
|
|
|
|
// 然后是文档对象
|
|
// 然后是文档对象
|
|
if (game_url.indexOf("!doctype") !== -1) {
|
|
if (game_url.indexOf("!doctype") !== -1) {
|
|
@@ -57,8 +61,10 @@ const useGame = () => {
|
|
const url = `${encodeURI(res.data.game_url)}&return_url=${encodeURI(window.location.href.replace(pathname, ""))}&category_name=${game.provider}`;
|
|
const url = `${encodeURI(res.data.game_url)}&return_url=${encodeURI(window.location.href.replace(pathname, ""))}&category_name=${game.provider}`;
|
|
|
|
|
|
// 如果是pp游戏,则当前窗口打开新的地址,不需要加return_url
|
|
// 如果是pp游戏,则当前窗口打开新的地址,不需要加return_url
|
|
- if(category_name === 'PP'){
|
|
|
|
|
|
+ if(categoryName.toLowerCase() === 'pp'){
|
|
const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
|
|
const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
|
|
|
|
+ console.log('ppUrl',ppUrl)
|
|
|
|
+ return
|
|
window.open(ppUrl,'_self');
|
|
window.open(ppUrl,'_self');
|
|
return
|
|
return
|
|
}
|
|
}
|