@jetthai/cuora 1.1.430-dev.1 → 1.1.430
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/.claude/settings.local.json +1 -3
- package/.prettierignore +1 -2
- package/CHANGELOG.md +9 -118
- package/package.json +1 -1
- package/scripts/auto-version.js +0 -1
- package/src/api/activity.js +0 -5
- package/src/machine/auth.js +0 -19
- package/src/machine/deposit/crypto_way_cash.js +4 -20
- package/src/machine/game_v2_1.js +12 -20
- package/docs/kibana/crypto-way-deposit-amount-bug-analysis.md +0 -1003
- package/docs/kibana/play-providerId-error.md +0 -202
- package/docs/kibana/play-selectedWalletType.md +0 -1
- package/docs/kibana/play-selectedWalletType_2.md +0 -1
- package/docs/kibana/play-selectedWalletType_analysis.md +0 -565
package/.prettierignore
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
dist/
|
|
2
|
-
CHANGELOG.md
|
|
1
|
+
dist/
|
package/CHANGELOG.md
CHANGED
|
@@ -2,66 +2,27 @@
|
|
|
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.430
|
|
6
|
-
|
|
7
|
-
### [1.1.430-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.431-dev.0...v1.1.430-dev.0) (2026-04-28)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
### Bug Fixes
|
|
11
|
-
|
|
12
|
-
* **deposit:** 修正 crypto_way_cash inputAmount 清空時未重置狀態 ([2630a06](https://github.com/jetthai/cuora-module/commit/2630a060b0a43d27a0a727c0e0e5efe0306b2ca9))
|
|
13
|
-
* **deposit:** 修正 crypto_way_cash setAmount 清空時未重置狀態 ([2fc0c08](https://github.com/jetthai/cuora-module/commit/2fc0c08d3e49e321319bef27bcdb52b4491a98a0))
|
|
14
|
-
|
|
15
|
-
### [1.1.429-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.429-dev.0) (2026-04-14)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Features
|
|
19
|
-
|
|
20
|
-
* **husky:** skip pre-push hooks on force push to dev/qa ([79e9df9](https://github.com/jetthai/cuora-module/commit/79e9df9bfd9335dca7d5aec590fa25d7580586ac))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Bug Fixes
|
|
24
|
-
|
|
25
|
-
* **deposit:** 修正 crypto_way_cash 計算失敗狀態及提交金額驗證 ([726c449](https://github.com/jetthai/cuora-module/commit/726c4493267b6ca502fc241385b251f6caaf84b5))
|
|
26
|
-
* **deposit:** 強化 crypto_way_cash isSubmittable guard 的金額驗證 ([9361a5c](https://github.com/jetthai/cuora-module/commit/9361a5cc37bb0d7d65144b875baecced7f7e0f9f))
|
|
27
|
-
* **deposit:** 防止 crypto_way_cash 金額輸入 NaN 及負數 ([608da8a](https://github.com/jetthai/cuora-module/commit/608da8a35dc111ee3e7e9fccea94a366d1b99599))
|
|
28
|
-
* **game:** 防止 connectGame 將字串 "null" 的 providerId 送至後端 ([6bd8b60](https://github.com/jetthai/cuora-module/commit/6bd8b6017f351bd53295abb494835c66c65561fe))
|
|
29
|
-
* **game:** 防止 selectedWalletType 為 null 送至後端 ([e62d195](https://github.com/jetthai/cuora-module/commit/e62d195cc12a0ec1021480e4c76b62005925da54))
|
|
30
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
31
|
-
|
|
32
|
-
### [1.1.428-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.428-dev.1...v1.1.428-dev.2) (2026-04-13)
|
|
5
|
+
### [1.1.430](https://github.com/jetthai/cuora-module/compare/v1.1.427-hotfix.1...v1.1.430) (2026-04-14)
|
|
33
6
|
|
|
7
|
+
### [1.1.429](https://github.com/jetthai/cuora-module/compare/v1.1.428...v1.1.429) (2026-04-14)
|
|
34
8
|
|
|
35
9
|
### Bug Fixes
|
|
36
10
|
|
|
37
|
-
|
|
11
|
+
- **withdraw:** 修正加密貨幣提款計算錯誤時的狀態轉移 ([5fe9d9e](https://github.com/jetthai/cuora-module/commit/5fe9d9e32ec101c8054dd3c006d76f52616b436b))
|
|
38
12
|
|
|
39
|
-
### [1.1.428
|
|
13
|
+
### [1.1.428](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.428) (2026-04-13)
|
|
40
14
|
|
|
15
|
+
### [1.1.429](https://github.com/jetthai/cuora-module/compare/v1.1.428...v1.1.429) (2026-04-14)
|
|
41
16
|
|
|
42
17
|
### Bug Fixes
|
|
43
18
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### [1.1.428-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.428-dev.0) (2026-04-13)
|
|
19
|
+
- **withdraw:** 修正加密貨幣提款計算錯誤時的狀態轉移 ([5fe9d9e](https://github.com/jetthai/cuora-module/commit/5fe9d9e32ec101c8054dd3c006d76f52616b436b))
|
|
47
20
|
|
|
21
|
+
### [1.1.428](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.428) (2026-04-13)
|
|
48
22
|
|
|
49
23
|
### Features
|
|
50
24
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
### Bug Fixes
|
|
55
|
-
|
|
56
|
-
* **deposit:** 修正 crypto_way_cash 計算失敗狀態及提交金額驗證 ([726c449](https://github.com/jetthai/cuora-module/commit/726c4493267b6ca502fc241385b251f6caaf84b5))
|
|
57
|
-
* **deposit:** 強化 crypto_way_cash isSubmittable guard 的金額驗證 ([9361a5c](https://github.com/jetthai/cuora-module/commit/9361a5cc37bb0d7d65144b875baecced7f7e0f9f))
|
|
58
|
-
* **deposit:** 防止 crypto_way_cash 金額輸入 NaN 及負數 ([608da8a](https://github.com/jetthai/cuora-module/commit/608da8a35dc111ee3e7e9fccea94a366d1b99599))
|
|
59
|
-
|
|
60
|
-
### [1.1.427-dev.5](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.427-dev.5) (2026-04-12)
|
|
61
|
-
|
|
62
|
-
### [1.1.427-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.427-dev.0...v1.1.427-dev.4) (2026-04-12)
|
|
63
|
-
|
|
64
|
-
### [1.1.427-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.427-dev.0) (2026-04-12)
|
|
25
|
+
- **husky:** skip pre-push hooks on force push to dev/qa ([79e9df9](https://github.com/jetthai/cuora-module/commit/79e9df9bfd9335dca7d5aec590fa25d7580586ac))
|
|
65
26
|
|
|
66
27
|
### [1.1.427](https://github.com/jetthai/cuora-module/compare/v1.1.426...v1.1.427) (2026-04-07)
|
|
67
28
|
|
|
@@ -81,77 +42,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
81
42
|
|
|
82
43
|
### [1.1.424](https://github.com/jetthai/cuora-module/compare/v1.1.423...v1.1.424) (2026-03-17)
|
|
83
44
|
|
|
84
|
-
### [1.1.
|
|
85
|
-
|
|
86
|
-
### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
|
|
87
|
-
|
|
88
|
-
### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
|
|
89
|
-
|
|
90
|
-
### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
|
|
91
|
-
|
|
92
|
-
### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
|
|
93
|
-
|
|
94
|
-
### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
|
|
95
|
-
|
|
96
|
-
### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
|
|
97
|
-
|
|
98
|
-
### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
|
|
99
|
-
|
|
100
|
-
### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
|
|
101
|
-
|
|
102
|
-
### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
|
|
103
|
-
|
|
104
|
-
### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
|
|
105
|
-
|
|
106
|
-
### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
|
|
107
|
-
|
|
108
|
-
### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
|
|
109
|
-
|
|
110
|
-
### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
|
|
111
|
-
|
|
112
|
-
### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
|
|
113
|
-
|
|
114
|
-
### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
|
|
115
|
-
|
|
116
|
-
### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
|
|
117
|
-
|
|
118
|
-
### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
|
|
119
|
-
|
|
120
|
-
### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
|
|
121
|
-
|
|
122
|
-
### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
|
|
123
|
-
|
|
124
|
-
### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
|
|
125
|
-
|
|
126
|
-
### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
|
|
127
|
-
|
|
128
|
-
### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
|
|
129
|
-
|
|
130
|
-
### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
|
|
131
|
-
|
|
132
|
-
### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
|
|
133
|
-
|
|
134
|
-
### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
|
|
135
|
-
|
|
136
|
-
### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
|
|
137
|
-
|
|
138
|
-
### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
|
|
139
|
-
|
|
140
|
-
### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
|
|
141
|
-
|
|
142
|
-
### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
|
|
143
|
-
|
|
144
|
-
### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
|
|
145
|
-
|
|
146
|
-
### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
|
|
147
|
-
|
|
148
|
-
### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
|
|
149
|
-
|
|
150
|
-
### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
|
|
151
|
-
|
|
152
|
-
### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
|
|
153
|
-
|
|
154
|
-
### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
|
|
45
|
+
### [1.1.423](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.423) (2026-03-17)
|
|
155
46
|
|
|
156
47
|
### [1.1.422](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.422) (2026-03-16)
|
|
157
48
|
|
package/package.json
CHANGED
package/scripts/auto-version.js
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -120,9 +120,4 @@ export default {
|
|
|
120
120
|
method: 'post',
|
|
121
121
|
params: { startDate, endDate, appSecret },
|
|
122
122
|
}),
|
|
123
|
-
getMissionHistory: ({ activityNo, appSecret }) => ({
|
|
124
|
-
url: 'activities/mission-history',
|
|
125
|
-
method: 'get',
|
|
126
|
-
params: { activityNo, appSecret },
|
|
127
|
-
}),
|
|
128
123
|
}
|
package/src/machine/auth.js
CHANGED
|
@@ -476,9 +476,6 @@ export default function (request) {
|
|
|
476
476
|
|
|
477
477
|
const affiliateCode = storage.get('ac')
|
|
478
478
|
const nickname = storage.get('nk')
|
|
479
|
-
const phone = storage.get('tp_phone')
|
|
480
|
-
const countryCode = storage.get('tp_countryCode')
|
|
481
|
-
const email = storage.get('tp_email')
|
|
482
479
|
const messages = {
|
|
483
480
|
url: window.location.href,
|
|
484
481
|
channelOrders: [
|
|
@@ -500,25 +497,9 @@ export default function (request) {
|
|
|
500
497
|
referralObj.nick_name = nickname
|
|
501
498
|
}
|
|
502
499
|
|
|
503
|
-
if (![undefined, 'undefined', null, 'null'].includes(phone)) {
|
|
504
|
-
referralObj.phone = phone
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
if (![undefined, 'undefined', null, 'null'].includes(countryCode)) {
|
|
508
|
-
referralObj.countryCode = countryCode
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
if (![undefined, 'undefined', null, 'null'].includes(email)) {
|
|
512
|
-
referralObj.email = email
|
|
513
|
-
}
|
|
514
|
-
|
|
515
500
|
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
516
501
|
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
517
502
|
|
|
518
|
-
storage.remove('tp_phone')
|
|
519
|
-
storage.remove('tp_countryCode')
|
|
520
|
-
storage.remove('tp_email')
|
|
521
|
-
|
|
522
503
|
const fullURL = request.config.fullURL
|
|
523
504
|
|
|
524
505
|
const redirectURL = urljoin(
|
|
@@ -56,9 +56,8 @@ export default function (request, context) {
|
|
|
56
56
|
target: 'calculated',
|
|
57
57
|
actions: 'setCalculation',
|
|
58
58
|
},
|
|
59
|
-
// 計算失敗回到 loaded,避免進入 calculated 造成 UI 與 state 不一致
|
|
60
59
|
onError: {
|
|
61
|
-
target: '
|
|
60
|
+
target: 'calculated',
|
|
62
61
|
},
|
|
63
62
|
},
|
|
64
63
|
},
|
|
@@ -168,10 +167,8 @@ export default function (request, context) {
|
|
|
168
167
|
setAmount: assign((context, event) => {
|
|
169
168
|
// 現金網可自由填額度,grandTotalEnable 欄位感覺不再需要?
|
|
170
169
|
if (context.selectedCrypto?.grandTotalEnable === 1) {
|
|
171
|
-
// 累加模式:用 Math.max 確保累加結果不低於 0
|
|
172
|
-
const result = preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data || '0')}`)
|
|
173
170
|
return {
|
|
174
|
-
selectedAmount:
|
|
171
|
+
selectedAmount: preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data)}`),
|
|
175
172
|
}
|
|
176
173
|
} else {
|
|
177
174
|
return { selectedAmount: event.data }
|
|
@@ -234,17 +231,9 @@ export default function (request, context) {
|
|
|
234
231
|
const { selectedCrypto, selectedAmount } = context
|
|
235
232
|
return selectedCrypto && selectedAmount && selectedCrypto.minimum <= +selectedAmount && +selectedAmount <= selectedCrypto.maximum
|
|
236
233
|
},
|
|
237
|
-
// 提交前最後一道 guard:重新驗證 amount 的合法性(與 isCalculable 同等嚴格)
|
|
238
234
|
isSubmittable: (context, event) => {
|
|
239
235
|
const { selectedCrypto, selectedAmount, calculation } = context
|
|
240
|
-
return
|
|
241
|
-
selectedCrypto &&
|
|
242
|
-
selectedAmount &&
|
|
243
|
-
+selectedAmount > 0 &&
|
|
244
|
-
selectedCrypto.minimum <= +selectedAmount &&
|
|
245
|
-
+selectedAmount <= selectedCrypto.maximum &&
|
|
246
|
-
calculation
|
|
247
|
-
)
|
|
236
|
+
return selectedCrypto && selectedAmount && calculation
|
|
248
237
|
},
|
|
249
238
|
},
|
|
250
239
|
services: {
|
|
@@ -261,15 +250,10 @@ export default function (request, context) {
|
|
|
261
250
|
},
|
|
262
251
|
submitDeposit: async (context, event) => {
|
|
263
252
|
const { selectedCrypto, selectedAmount, sourceAddress, promotion } = context
|
|
264
|
-
// 防禦性檢查:將 amount 轉為數字型別,並驗證範圍合法性,避免非法金額送出 API
|
|
265
|
-
const amount = +selectedAmount
|
|
266
|
-
if (!amount || amount <= 0 || amount < selectedCrypto.minimum || amount > selectedCrypto.maximum) {
|
|
267
|
-
throw new Error('INVALID_AMOUNT')
|
|
268
|
-
}
|
|
269
253
|
return await request.send(
|
|
270
254
|
payment.submitDepositTransactionCrypto({
|
|
271
255
|
method: selectedCrypto.method,
|
|
272
|
-
amount:
|
|
256
|
+
amount: selectedAmount,
|
|
273
257
|
cryptoCurrency: selectedCrypto.channel,
|
|
274
258
|
cryptoNetwork: selectedCrypto.networkCode,
|
|
275
259
|
sourceAddress: sourceAddress,
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -53,7 +53,6 @@ export default function (request) {
|
|
|
53
53
|
gameWalletType: null,
|
|
54
54
|
switchGame: null,
|
|
55
55
|
isPlaying: false,
|
|
56
|
-
entry: null,
|
|
57
56
|
},
|
|
58
57
|
states: {
|
|
59
58
|
flow: {
|
|
@@ -86,15 +85,15 @@ export default function (request) {
|
|
|
86
85
|
},
|
|
87
86
|
ENTER_GAME: {
|
|
88
87
|
target: 'connecting',
|
|
89
|
-
actions: ['setGameInfo', 'setLang', '
|
|
88
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
90
89
|
},
|
|
91
90
|
DEMO_GAME: {
|
|
92
91
|
target: 'demoGame',
|
|
93
|
-
actions: ['setGameInfo', 'setLang', '
|
|
92
|
+
actions: ['setGameInfo', 'setLang', 'setSite'],
|
|
94
93
|
},
|
|
95
94
|
MENU_ENTER_GAME: {
|
|
96
95
|
target: 'connecting',
|
|
97
|
-
actions: ['setGameInfo', 'setLang', '
|
|
96
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
98
97
|
},
|
|
99
98
|
UPDATE: {
|
|
100
99
|
target: 'updating',
|
|
@@ -227,14 +226,14 @@ export default function (request) {
|
|
|
227
226
|
},
|
|
228
227
|
MENU_ENTER_GAME: {
|
|
229
228
|
target: 'connectSwitching',
|
|
230
|
-
actions: ['setSwitch', 'setLang', '
|
|
229
|
+
actions: ['setSwitch', 'setLang', 'setWalletType'],
|
|
231
230
|
},
|
|
232
231
|
ENTER_GAME_PAUSE: {
|
|
233
232
|
actions: ['setIsPlaying', 'resetContent', 'resetSHA'],
|
|
234
233
|
},
|
|
235
234
|
ENTER_GAME: {
|
|
236
235
|
target: 'connecting',
|
|
237
|
-
actions: ['setGameInfo', 'setLang', '
|
|
236
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
238
237
|
},
|
|
239
238
|
},
|
|
240
239
|
},
|
|
@@ -248,7 +247,7 @@ export default function (request) {
|
|
|
248
247
|
},
|
|
249
248
|
ENTER_GAME: {
|
|
250
249
|
target: 'connecting',
|
|
251
|
-
actions: ['setGameInfo', 'setLang', '
|
|
250
|
+
actions: ['setGameInfo', 'setLang', 'setWalletType'],
|
|
252
251
|
},
|
|
253
252
|
},
|
|
254
253
|
},
|
|
@@ -466,18 +465,13 @@ export default function (request) {
|
|
|
466
465
|
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name, gameName } = context.switchGame
|
|
467
466
|
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name, gameName } }
|
|
468
467
|
}),
|
|
469
|
-
// 頁面刷新或深層連結時,event.data.walletType 可能為 undefined/null
|
|
470
|
-
// 使用 ?? 確保不會覆蓋 context 中已有的 walletType,避免後端收到 selectedWalletType=null
|
|
471
468
|
setWalletType: assign((context, event) => {
|
|
472
|
-
return { walletType: event.data.walletType
|
|
469
|
+
return { walletType: event.data.walletType }
|
|
473
470
|
}),
|
|
474
471
|
setLang: assign((context, event) => {
|
|
475
472
|
const lang = event.data.locale.replace('-', '_')
|
|
476
473
|
return { lang }
|
|
477
474
|
}),
|
|
478
|
-
setEntry: assign((context, event) => {
|
|
479
|
-
return { entry: event?.data?.entrySource }
|
|
480
|
-
}),
|
|
481
475
|
setSite: assign((context, event) => {
|
|
482
476
|
const site = event.data.site
|
|
483
477
|
return { site }
|
|
@@ -644,13 +638,13 @@ export default function (request) {
|
|
|
644
638
|
}
|
|
645
639
|
},
|
|
646
640
|
connectGame: async (context, event) => {
|
|
647
|
-
// [防呆] 確保有 providerId 和 gameId
|
|
641
|
+
// [防呆] 確保有 providerId 和 gameId
|
|
648
642
|
const { providerId, gameId } = context.game || {}
|
|
649
|
-
if (!providerId || !gameId
|
|
643
|
+
if (!providerId || !gameId) {
|
|
650
644
|
return
|
|
651
645
|
}
|
|
652
646
|
const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
|
|
653
|
-
const { lang,
|
|
647
|
+
const { lang, isMobile, walletType } = context
|
|
654
648
|
const { gameTypeId, mappingId } = context.game
|
|
655
649
|
const params = {
|
|
656
650
|
provider_id: providerId,
|
|
@@ -660,8 +654,7 @@ export default function (request) {
|
|
|
660
654
|
is_demo: false,
|
|
661
655
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
662
656
|
lang,
|
|
663
|
-
|
|
664
|
-
selected_wallet_type: walletType || null, // 統一 undefined → null,確保後端收到一致的值
|
|
657
|
+
selected_wallet_type: walletType,
|
|
665
658
|
return_url: returnProviders.includes(providerId)
|
|
666
659
|
? `${window.location.origin}${context.base}return`
|
|
667
660
|
: window.location.href?.split('?')?.[0], // For providers to return.
|
|
@@ -670,7 +663,7 @@ export default function (request) {
|
|
|
670
663
|
return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
|
|
671
664
|
},
|
|
672
665
|
demoGame: async (context, event) => {
|
|
673
|
-
const { lang,
|
|
666
|
+
const { lang, site, isMobile, game } = context
|
|
674
667
|
const { providerId, gameId, gameTypeId, mappingId } = context.game
|
|
675
668
|
const params = {
|
|
676
669
|
site,
|
|
@@ -680,7 +673,6 @@ export default function (request) {
|
|
|
680
673
|
mapping_id: mappingId,
|
|
681
674
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
682
675
|
lang,
|
|
683
|
-
entry_source: entry || 'Other',
|
|
684
676
|
appSecret,
|
|
685
677
|
}
|
|
686
678
|
const { type, redirect_url, gameToken, gameHtml, is_demo } = await request.send(api.demoGame(params))
|