@jetthai/cuora 1.1.383 → 1.1.385
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/machine/game_v2_1.js +56 -1
- package/src/request/request.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.385](https://github.com/jetthai/cuora-module/compare/v1.1.384...v1.1.385) (2025-09-17)
|
|
6
|
+
|
|
7
|
+
### [1.1.384](https://github.com/jetthai/cuora-module/compare/v1.1.383...v1.1.384) (2025-09-16)
|
|
8
|
+
|
|
5
9
|
### [1.1.383](https://github.com/jetthai/cuora-module/compare/v1.1.382...v1.1.383) (2025-09-16)
|
|
6
10
|
|
|
7
11
|
### [1.1.382](https://github.com/jetthai/cuora-module/compare/v1.1.381...v1.1.382) (2025-09-16)
|
package/package.json
CHANGED
package/src/machine/game_v2_1.js
CHANGED
|
@@ -5,7 +5,7 @@ import { GAME_SEARCH } from '../util/constant.js'
|
|
|
5
5
|
|
|
6
6
|
// 對應 intersectionObserver 版本
|
|
7
7
|
export default function (request) {
|
|
8
|
-
const { appSecret } = request.config
|
|
8
|
+
const { appSecret, sentry } = request.config
|
|
9
9
|
return createMachine(
|
|
10
10
|
{
|
|
11
11
|
id: 'game',
|
|
@@ -518,6 +518,17 @@ export default function (request) {
|
|
|
518
518
|
} else if (additionEnable) {
|
|
519
519
|
const param = { categoryId: room.categoryId, index, appSecret }
|
|
520
520
|
requestChain = event.data.list.map((category, b) => {
|
|
521
|
+
// 參數必填檢查
|
|
522
|
+
if (!category?.id) {
|
|
523
|
+
sentry?.captureMessage('PARAMETER_ERROR', {
|
|
524
|
+
level: 'warning',
|
|
525
|
+
tags: {
|
|
526
|
+
caller: 'batchFetch',
|
|
527
|
+
action: 'getListCategory',
|
|
528
|
+
param: JSON.stringify(category?.id),
|
|
529
|
+
},
|
|
530
|
+
})
|
|
531
|
+
}
|
|
521
532
|
return request
|
|
522
533
|
.send(
|
|
523
534
|
api.getListCategory({
|
|
@@ -528,10 +539,32 @@ export default function (request) {
|
|
|
528
539
|
)
|
|
529
540
|
.then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
|
|
530
541
|
})
|
|
542
|
+
// 參數必填檢查
|
|
543
|
+
if (!param?.categoryId) {
|
|
544
|
+
sentry?.captureMessage('PARAMETER_ERROR', {
|
|
545
|
+
level: 'warning',
|
|
546
|
+
tags: {
|
|
547
|
+
caller: 'batchFetch',
|
|
548
|
+
action: 'getListAddition',
|
|
549
|
+
param: JSON.stringify(param),
|
|
550
|
+
},
|
|
551
|
+
})
|
|
552
|
+
}
|
|
531
553
|
const result = await Promise.all([...requestChain, request.send(api.getListAddition(param))])
|
|
532
554
|
return result.filter((item) => item.downLine.length > 0).slice(0, 6)
|
|
533
555
|
} else {
|
|
534
556
|
requestChain = event.data.list.map((category, b) => {
|
|
557
|
+
// 參數必填檢查
|
|
558
|
+
if (!category?.id) {
|
|
559
|
+
sentry?.captureMessage('PARAMETER_ERROR', {
|
|
560
|
+
level: 'warning',
|
|
561
|
+
tags: {
|
|
562
|
+
caller: 'batchFetch/else',
|
|
563
|
+
action: 'getListCategory',
|
|
564
|
+
param: JSON.stringify(category?.id),
|
|
565
|
+
},
|
|
566
|
+
})
|
|
567
|
+
}
|
|
535
568
|
return request
|
|
536
569
|
.send(
|
|
537
570
|
api.getListCategory({
|
|
@@ -562,9 +595,31 @@ export default function (request) {
|
|
|
562
595
|
]
|
|
563
596
|
} else if (additionEnable) {
|
|
564
597
|
const param = { categoryId: room.categoryId, index, appSecret }
|
|
598
|
+
// 參數必填檢查
|
|
599
|
+
if (!param?.categoryId) {
|
|
600
|
+
sentry?.captureMessage('PARAMETER_ERROR', {
|
|
601
|
+
level: 'warning',
|
|
602
|
+
tags: {
|
|
603
|
+
caller: 'getPageContent',
|
|
604
|
+
action: 'getListCategory/getListAddition',
|
|
605
|
+
param: JSON.stringify(param),
|
|
606
|
+
},
|
|
607
|
+
})
|
|
608
|
+
}
|
|
565
609
|
return await Promise.all([request.send(api.getListCategory(param)), request.send(api.getListAddition(param))])
|
|
566
610
|
} else {
|
|
567
611
|
const param = { categoryId: room.categoryId, index, appSecret }
|
|
612
|
+
// 參數必填檢查
|
|
613
|
+
if (!param?.categoryId) {
|
|
614
|
+
sentry?.captureMessage('PARAMETER_ERROR', {
|
|
615
|
+
level: 'warning',
|
|
616
|
+
tags: {
|
|
617
|
+
caller: 'getPageContent/else',
|
|
618
|
+
action: 'getListCategory',
|
|
619
|
+
param: JSON.stringify(param),
|
|
620
|
+
},
|
|
621
|
+
})
|
|
622
|
+
}
|
|
568
623
|
return await Promise.all([request.send(api.getListCategory(param))])
|
|
569
624
|
}
|
|
570
625
|
},
|
package/src/request/request.js
CHANGED
|
@@ -170,7 +170,7 @@ export default class Request {
|
|
|
170
170
|
// 針對key為q的參數進行手動編碼,避免雙重編碼
|
|
171
171
|
if (key === 'q' && typeof value === 'string') {
|
|
172
172
|
// 處理其他需要編碼的字符
|
|
173
|
-
value = value.replace(/[!'()*]/g, function (c) {
|
|
173
|
+
value = encodeURIComponent(value).replace(/[!'()*]/g, function (c) {
|
|
174
174
|
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
|
175
175
|
})
|
|
176
176
|
} else {
|