Mẫu cấu hình đối tượng danh mục trò chơi s168 phục vụ kiểm tra dữ liệu cục bộ.
{ } s168_config.js{ } s168_config.json
Sao chép mã
JavaScript
// Cau hinh danh muc tro choi s168 cuc bo
const s168LocalConfig = {
platform: 'android' ,
defaultGameId: '022' ,
availableGames: [
{ id: '022' , name: 'Legend Of Hou Yi' , category: 'Nổ hũ' },
{ id: '015' , name: 'Gem Saviour' , category: 'Nổ hũ phiêu lưu' },
{ id: '054' , name: 'Reel Love' , category: 'Nổ hũ' },
{ id: '149' , name: 'Fortune Dragon' , category: 'Nổ hũ' },
{ id: '174' , name: 'Dead Man Riches' , category: 'Nổ hũ' }
],
logPreference: 'console'
};
function getGameInfo(id) {
return s168LocalConfig.availableGames.find(item => item.id === id) || null ;
}
// Kiem tra du lieu cuc bo
const selected = getGameInfo(s168LocalConfig.defaultGameId);
console.log('Tro choi mac dinh:' , selected ? selected.name : 'Khong tim thay' ); JSON
{
"platform" : "android" ,
"defaultGameId" : "022" ,
"availableGames" : [
{
"id" : "022" ,
"name" : "Legend Of Hou Yi" ,
"category" : "Nổ hũ"
},
{
"id" : "015" ,
"name" : "Gem Saviour" ,
"category" : "Nổ hũ phiêu lưu"
},
{
"id" : "054" ,
"name" : "Reel Love" ,
"category" : "Nổ hũ"
},
{
"id" : "149" ,
"name" : "Fortune Dragon" ,
"category" : "Nổ hũ"
},
{
"id" : "174" ,
"name" : "Dead Man Riches" ,
"category" : "Nổ hũ"
}
],
"logPreference" : "console"
}