|
@@ -48,7 +48,7 @@ const useGame = () => {
|
|
|
|
|
|
// 获取游戏的品牌
|
|
// 获取游戏的品牌
|
|
const categoryName:any = game?.category_name;
|
|
const categoryName:any = game?.category_name;
|
|
- const gameId= game?.game_id;
|
|
|
|
|
|
+ const gameId= game?.game_id || '';
|
|
|
|
|
|
console.log('category_name222',gameId,/^1\d{5}$/.test(gameId))
|
|
console.log('category_name222',gameId,/^1\d{5}$/.test(gameId))
|
|
|
|
|
|
@@ -64,7 +64,8 @@ const useGame = () => {
|
|
// 如果是pp游戏,则当前窗口打开新的地址,不需要加return_url
|
|
// 如果是pp游戏,则当前窗口打开新的地址,不需要加return_url
|
|
// gid 如果开头是1的6位数的数字,则认为是pp游戏
|
|
// gid 如果开头是1的6位数的数字,则认为是pp游戏
|
|
// if(categoryName?.toLowerCase() === 'pp'){
|
|
// if(categoryName?.toLowerCase() === 'pp'){
|
|
- if(/^1\d{5}$/.test(gameId)){
|
|
|
|
|
|
+ let isPP = /^1\d{5}$/.test(gameId)
|
|
|
|
+ if(!!isPP){
|
|
const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
|
|
const ppUrl = `${encodeURI(res.data.game_url)}&category_name=${game.provider}`;
|
|
console.log('category_name333',ppUrl)
|
|
console.log('category_name333',ppUrl)
|
|
window.open(ppUrl,'_self');
|
|
window.open(ppUrl,'_self');
|