@jetthai/cuora 1.1.407-1 → 1.1.407
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/machine/game_info.js +0 -4
- package/src/machine/game_v2_1.js +25 -55
package/package.json
CHANGED
package/src/machine/game_info.js
CHANGED
|
@@ -49,10 +49,6 @@ export default function (request, context) {
|
|
|
49
49
|
services: {
|
|
50
50
|
// 取得遊戲資訊
|
|
51
51
|
fetchGameInfo: async (context, event) => {
|
|
52
|
-
// [防呆] 確保有 gameCode
|
|
53
|
-
if (!gameCode) {
|
|
54
|
-
return { data: {} }
|
|
55
|
-
}
|
|
56
52
|
return await request.send(game.getGameInfo({ appSecret, gameCode }))
|
|
57
53
|
},
|
|
58
54
|
},
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -390,10 +390,6 @@ export default function (request) {
|
|
|
390
390
|
}),
|
|
391
391
|
appendContent: assign((context, event) => {
|
|
392
392
|
const { room, additionEnable } = context
|
|
393
|
-
// [防呆] 確保有 categoryId
|
|
394
|
-
if (!room?.categoryId) {
|
|
395
|
-
return
|
|
396
|
-
}
|
|
397
393
|
if (room.categoryId === GAME_SEARCH) {
|
|
398
394
|
return
|
|
399
395
|
} else if (additionEnable) {
|
|
@@ -521,60 +517,38 @@ export default function (request) {
|
|
|
521
517
|
})
|
|
522
518
|
return list.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
523
519
|
} else if (additionEnable) {
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
)
|
|
539
|
-
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
540
|
-
)
|
|
541
|
-
const promises = [...requestChain]
|
|
542
|
-
if (hasCategoryId) {
|
|
543
|
-
promises.push(request.send(api.getListAddition(param)))
|
|
544
|
-
}
|
|
545
|
-
const result = await Promise.all(promises)
|
|
546
|
-
return result.filter((item) => item.downLine?.length > 0).slice(0, 6)
|
|
520
|
+
const param = { categoryId: room.categoryId, index, appSecret }
|
|
521
|
+
requestChain = event.data.list.map((category, b) => {
|
|
522
|
+
return request
|
|
523
|
+
.send(
|
|
524
|
+
api.getListCategory({
|
|
525
|
+
categoryId: category.id,
|
|
526
|
+
index: 0,
|
|
527
|
+
appSecret,
|
|
528
|
+
})
|
|
529
|
+
)
|
|
530
|
+
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
531
|
+
})
|
|
532
|
+
const result = await Promise.all([...requestChain, request.send(api.getListAddition(param))])
|
|
533
|
+
return result.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
547
534
|
} else {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
)
|
|
560
|
-
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
561
|
-
)
|
|
535
|
+
requestChain = event.data.list.map((category, b) => {
|
|
536
|
+
return request
|
|
537
|
+
.send(
|
|
538
|
+
api.getListCategory({
|
|
539
|
+
categoryId: category.id,
|
|
540
|
+
index: 0,
|
|
541
|
+
appSecret,
|
|
542
|
+
})
|
|
543
|
+
)
|
|
544
|
+
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
545
|
+
})
|
|
562
546
|
const result = await Promise.all([...requestChain])
|
|
563
547
|
return result.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
564
548
|
}
|
|
565
549
|
},
|
|
566
550
|
getPageContent: async (context, event) => {
|
|
567
551
|
const { room, index, additionEnable, staticData } = context
|
|
568
|
-
// [防呆] 確保有 categoryId
|
|
569
|
-
if (!room?.categoryId) {
|
|
570
|
-
return [
|
|
571
|
-
{
|
|
572
|
-
data: [],
|
|
573
|
-
totalPage: 0,
|
|
574
|
-
timestamp: context.content?.timestamp ?? null,
|
|
575
|
-
},
|
|
576
|
-
]
|
|
577
|
-
}
|
|
578
552
|
if (room.categoryId === GAME_SEARCH) {
|
|
579
553
|
return
|
|
580
554
|
} else if (!request.getToken()) {
|
|
@@ -597,10 +571,6 @@ export default function (request) {
|
|
|
597
571
|
},
|
|
598
572
|
updatePageContent: async (context, event) => {
|
|
599
573
|
const { room, content, index, additionEnable } = context
|
|
600
|
-
// [防呆] 確保有 categoryId
|
|
601
|
-
if (!room?.categoryId) {
|
|
602
|
-
return []
|
|
603
|
-
}
|
|
604
574
|
if (room.categoryId === GAME_SEARCH) {
|
|
605
575
|
return []
|
|
606
576
|
} else if (!request.getToken()) {
|