@jetthai/cuora 1.1.366-dev-2 → 1.1.366-dev-4
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 +30 -0
- package/package.json +1 -1
- package/src/api/activity.js +3 -3
- package/src/api/common.js +1 -1
- package/src/api/payment.js +5 -5
- package/src/api/ranking.js +2 -2
- package/src/machine/honor_board_cash.js +1 -1
- package/src/machine/inbox.js +9 -1
- package/src/machine/ranking.js +2 -1
- package/src/machine/reward.js +15 -5
- package/src/machine/reward_cash.js +15 -3
- package/src/machine/vip_table.js +11 -4
- package/src/request/request.js +194 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,32 @@
|
|
|
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.366-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.366-v2api-2...v1.1.366-dev-4) (2025-07-25)
|
|
6
|
+
|
|
7
|
+
### [1.1.366-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-2...v1.1.366-dev-3) (2025-07-18)
|
|
8
|
+
|
|
5
9
|
### [1.1.366-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-1...v1.1.366-dev-2) (2025-07-18)
|
|
6
10
|
|
|
7
11
|
### [1.1.366-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.366...v1.1.366-dev-1) (2025-07-18)
|
|
8
12
|
|
|
13
|
+
### [1.1.366-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-2...v1.1.366-dev-3) (2025-07-18)
|
|
14
|
+
|
|
15
|
+
### [1.1.366-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-1...v1.1.366-dev-2) (2025-07-18)
|
|
16
|
+
|
|
17
|
+
### [1.1.366-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.366...v1.1.366-dev-1) (2025-07-18)
|
|
18
|
+
|
|
19
|
+
### [1.1.366-v2api-2](https://github.com/jetthai/cuora-module/compare/v1.1.366-v2api-1...v1.1.366-v2api-2) (2025-07-18)
|
|
20
|
+
|
|
21
|
+
### [1.1.366-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.366...v1.1.366-v2api-1) (2025-07-18)
|
|
22
|
+
|
|
9
23
|
### [1.1.366](https://github.com/jetthai/cuora-module/compare/v1.1.365...v1.1.366) (2025-07-18)
|
|
10
24
|
|
|
25
|
+
### [1.1.365-v2api-3](https://github.com/jetthai/cuora-module/compare/v1.1.365-v2api-2...v1.1.365-v2api-3) (2025-07-18)
|
|
26
|
+
|
|
27
|
+
### [1.1.365-v2api-2](https://github.com/jetthai/cuora-module/compare/v1.1.365-v2api-1...v1.1.365-v2api-2) (2025-07-17)
|
|
28
|
+
|
|
29
|
+
### [1.1.365-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.365...v1.1.365-v2api-1) (2025-07-17)
|
|
30
|
+
|
|
11
31
|
### [1.1.365](https://github.com/jetthai/cuora-module/compare/v1.1.364...v1.1.365) (2025-07-08)
|
|
12
32
|
|
|
13
33
|
### [1.1.364](https://github.com/jetthai/cuora-module/compare/v1.1.363...v1.1.364) (2025-06-23)
|
|
@@ -16,18 +36,28 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
16
36
|
|
|
17
37
|
### [1.1.362](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.362) (2025-06-20)
|
|
18
38
|
|
|
39
|
+
### [1.1.361-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.361-v2api-1) (2025-06-05)
|
|
40
|
+
|
|
19
41
|
### [1.1.361](https://github.com/jetthai/cuora-module/compare/v1.1.360...v1.1.361) (2025-06-03)
|
|
20
42
|
|
|
21
43
|
### [1.1.360](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.360) (2025-06-03)
|
|
22
44
|
|
|
45
|
+
### [1.1.358-apiv2-2](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.358-apiv2-2) (2025-05-27)
|
|
46
|
+
|
|
23
47
|
### [1.1.359](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.359) (2025-05-23)
|
|
24
48
|
|
|
49
|
+
### [1.1.358-apiv2-1](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.358-apiv2-1) (2025-05-09)
|
|
50
|
+
|
|
25
51
|
### [1.1.358](https://github.com/jetthai/cuora-module/compare/v1.1.357...v1.1.358) (2025-05-09)
|
|
26
52
|
|
|
27
53
|
### [1.1.357](https://github.com/jetthai/cuora-module/compare/v1.1.356...v1.1.357) (2025-05-06)
|
|
28
54
|
|
|
29
55
|
### [1.1.356](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.356) (2025-04-29)
|
|
30
56
|
|
|
57
|
+
### [1.1.355-apiv2-2](https://github.com/jetthai/cuora-module/compare/v1.1.355-apiv2-1...v1.1.355-apiv2-2) (2025-05-07)
|
|
58
|
+
|
|
59
|
+
### [1.1.355-apiv2-1](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-apiv2-1) (2025-05-05)
|
|
60
|
+
|
|
31
61
|
### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
|
|
32
62
|
|
|
33
63
|
### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -69,10 +69,10 @@ export default {
|
|
|
69
69
|
method: 'get',
|
|
70
70
|
params: { rewardType },
|
|
71
71
|
}),
|
|
72
|
-
getRewardList: ({ rewardType, count, appSecret,
|
|
72
|
+
getRewardList: ({ rewardType, count, appSecret, orderColum, lang }) => ({
|
|
73
73
|
url: 'activities/rewards',
|
|
74
74
|
method: 'get',
|
|
75
|
-
params: { rewardType, count, appSecret,
|
|
75
|
+
params: { rewardType, count, appSecret, orderColum, lang },
|
|
76
76
|
}),
|
|
77
77
|
getCashRainReward: ({ activityNo, appSecret }) => ({
|
|
78
78
|
url: `activities/cashRain`,
|
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
settleAmount: (data) => ({ url: 'activities/exchange/diamond/settle', method: 'post', params: data }),
|
|
84
84
|
exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
|
|
85
85
|
collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
|
|
86
|
-
getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
|
|
86
|
+
getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
|
|
87
87
|
getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
|
|
88
88
|
exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
|
|
89
89
|
url: 'activities/exchange/diamond',
|
package/src/api/common.js
CHANGED
|
@@ -2,7 +2,7 @@ export default {
|
|
|
2
2
|
getConfig: ({ appSecret }) => ({ url: 'getConfig', method: 'get', params: { appSecret }, isPublic: true }),
|
|
3
3
|
getLayoutConfig: ({ appSecret }) => ({ url: 'getQuickLayout', method: 'get', params: { appSecret }, isPublic: true }),
|
|
4
4
|
feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
|
|
5
|
-
broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
|
|
5
|
+
broadcast: () => ({ url: 'broadcast', method: 'get', params: { appSecret }, isPublic: true }),
|
|
6
6
|
getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
|
|
7
7
|
getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
|
|
8
8
|
getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
|
package/src/api/payment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
|
|
3
|
-
getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
|
|
3
|
+
getSpotMarket: () => ({ url: 'payment/v2/spotmarket', method: 'get' }),
|
|
4
4
|
getTransactionHistory: (payload) => ({
|
|
5
5
|
url: 'payment/v2/transactionHistory',
|
|
6
6
|
method: 'post',
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
}),
|
|
9
9
|
getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
|
|
10
10
|
getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
|
|
11
|
-
getBindingPaymentInfo: () => ({ url: `payment/getBindingPaymentInfo`, method: 'get' }),
|
|
11
|
+
getBindingPaymentInfo: () => ({ url: `payment/v2/getBindingPaymentInfo`, method: 'get' }),
|
|
12
12
|
updatePaymentInfo: ({
|
|
13
13
|
bankCode,
|
|
14
14
|
branch,
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
}),
|
|
59
59
|
getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
|
|
60
60
|
getBindingBankList: ({ appSecret }) => ({ url: 'payment/v2/getBindingBankList', method: 'get', params: { appSecret }, isPublic: true }),
|
|
61
|
-
getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/getBindingPaymentList', method: 'get', params: { appSecret }, isPublic: true }),
|
|
61
|
+
getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/v2/getBindingPaymentList', method: 'get', params: { appSecret }, isPublic: true }),
|
|
62
62
|
getWithdrawBankList: () => ({ url: 'payment/v2/getWithdrawBankList', method: 'get' }),
|
|
63
63
|
makeTransaction: ({ type, payload, paymentMethod }) => ({
|
|
64
64
|
url: `payment/v2/${paymentMethod}/transaction`,
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
...payload,
|
|
69
69
|
},
|
|
70
70
|
}),
|
|
71
|
-
checkTransaction: (paymentMethod) => ({ url: `payment/${paymentMethod}/checkTransaction`, method: 'post' }),
|
|
71
|
+
checkTransaction: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/checkTransaction`, method: 'post' }),
|
|
72
72
|
setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
|
|
73
73
|
getCurrentWithdrawRule: () => ({ url: 'payment/v2/getCurrentWithdrawRule', method: 'get' }),
|
|
74
74
|
getDoubleWalletWithdrawRule: ({ walletType }) => ({
|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
method: 'post',
|
|
82
82
|
params: { exchangeType, cryptoNetwork, targetAddress },
|
|
83
83
|
}),
|
|
84
|
-
mergeWallet: () => ({ url: 'payment/mergeWallet', method: 'post' }),
|
|
84
|
+
mergeWallet: () => ({ url: 'payment/v2/mergeWallet', method: 'post' }),
|
|
85
85
|
getPaymentDetail: ({ transferType } = {}) => ({
|
|
86
86
|
url: 'payment/v2/paymentDetail',
|
|
87
87
|
method: 'post',
|
package/src/api/ranking.js
CHANGED
|
@@ -7,10 +7,10 @@ export default {
|
|
|
7
7
|
isPublic: true,
|
|
8
8
|
}),
|
|
9
9
|
// 登入後排名預設期數資料
|
|
10
|
-
getRankingOptions: ({ activityNo }) => ({
|
|
10
|
+
getRankingOptions: ({ activityNo, appSecret }) => ({
|
|
11
11
|
url: 'ranking/detail/option',
|
|
12
12
|
method: 'get',
|
|
13
|
-
params: { activityNo },
|
|
13
|
+
params: { activityNo, appSecret },
|
|
14
14
|
isPublic: true,
|
|
15
15
|
}),
|
|
16
16
|
// 登入後排名資料
|
|
@@ -80,7 +80,7 @@ export default function (request) {
|
|
|
80
80
|
},
|
|
81
81
|
services: {
|
|
82
82
|
fetchHonorBoardList: async (context, event) => {
|
|
83
|
-
const { data } = await request.send(activity.getHonorBroadcast(appSecret))
|
|
83
|
+
const { data } = await request.send(activity.getHonorBroadcast({ appSecret }))
|
|
84
84
|
return data
|
|
85
85
|
},
|
|
86
86
|
},
|
package/src/machine/inbox.js
CHANGED
|
@@ -247,6 +247,9 @@ export default function (request) {
|
|
|
247
247
|
CLEAR: {
|
|
248
248
|
actions: 'hideMessage',
|
|
249
249
|
},
|
|
250
|
+
SET_LANG: {
|
|
251
|
+
actions: 'setLang',
|
|
252
|
+
},
|
|
250
253
|
},
|
|
251
254
|
},
|
|
252
255
|
{
|
|
@@ -276,6 +279,10 @@ export default function (request) {
|
|
|
276
279
|
},
|
|
277
280
|
},
|
|
278
281
|
actions: {
|
|
282
|
+
setLang: assign((context, event) => {
|
|
283
|
+
const lang = event.data.locale || context.lang || 'en-US'
|
|
284
|
+
return { lang }
|
|
285
|
+
}),
|
|
279
286
|
reset: assign((context, event) => {
|
|
280
287
|
return {
|
|
281
288
|
currentTab: null,
|
|
@@ -415,9 +422,10 @@ export default function (request) {
|
|
|
415
422
|
return tabs
|
|
416
423
|
},
|
|
417
424
|
fetchMessages: async (context, event) => {
|
|
425
|
+
const lang = context.lang
|
|
418
426
|
const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
419
427
|
if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND')) {
|
|
420
|
-
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
428
|
+
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
421
429
|
inbox[currentTab] = { data, page: 0, totalPage: 1 }
|
|
422
430
|
} else {
|
|
423
431
|
const { page = -1 } = inbox[currentTab] || {}
|
package/src/machine/ranking.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createMachine, assign } from 'xstate'
|
|
|
2
2
|
import ranking from '../api/ranking.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
|
+
const { appSecret } = request.config
|
|
5
6
|
const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
|
|
6
7
|
const limit = { DAILY: 56, WEEKLY: 8, MONTHLY: 2, ALL: 2 }
|
|
7
8
|
|
|
@@ -199,7 +200,7 @@ export default function (request) {
|
|
|
199
200
|
},
|
|
200
201
|
fetchRankingOptions: async (context) => {
|
|
201
202
|
const { activityNo } = context
|
|
202
|
-
const { data } = await request.send(ranking.getRankingOptions({ activityNo }))
|
|
203
|
+
const { data } = await request.send(ranking.getRankingOptions({ activityNo, appSecret }))
|
|
203
204
|
return data
|
|
204
205
|
},
|
|
205
206
|
fetchRankingDetail: async (context, event) => {
|
package/src/machine/reward.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createMachine, assign, send } from 'xstate'
|
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
import payment from '../api/payment.js'
|
|
4
4
|
|
|
5
|
-
export default function (request) {
|
|
5
|
+
export default function (request, context) {
|
|
6
6
|
const { appSecret } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
@@ -19,6 +19,7 @@ export default function (request) {
|
|
|
19
19
|
isPlaying: false,
|
|
20
20
|
callback: () => {},
|
|
21
21
|
orderColumn: 'createTime',
|
|
22
|
+
lang: context?.locale,
|
|
22
23
|
},
|
|
23
24
|
states: {
|
|
24
25
|
timer: {
|
|
@@ -72,6 +73,9 @@ export default function (request) {
|
|
|
72
73
|
SET_IS_PLAYING: {
|
|
73
74
|
actions: 'setIsPlaying',
|
|
74
75
|
},
|
|
76
|
+
SET_LANG: {
|
|
77
|
+
actions: 'setLang',
|
|
78
|
+
},
|
|
75
79
|
},
|
|
76
80
|
},
|
|
77
81
|
fetching: {
|
|
@@ -193,6 +197,10 @@ export default function (request) {
|
|
|
193
197
|
isPlaying: event.data,
|
|
194
198
|
}
|
|
195
199
|
}),
|
|
200
|
+
setLang: assign((context, event) => {
|
|
201
|
+
const lang = event.data.locale || context.lang || 'en-US'
|
|
202
|
+
return { lang }
|
|
203
|
+
}),
|
|
196
204
|
},
|
|
197
205
|
guards: {
|
|
198
206
|
isPrize: (context, event) => {
|
|
@@ -205,22 +213,24 @@ export default function (request) {
|
|
|
205
213
|
},
|
|
206
214
|
services: {
|
|
207
215
|
fetchRewardList: async (context, event) => {
|
|
216
|
+
const lang = context.lang
|
|
208
217
|
const orderColumn = context.orderColumn
|
|
209
|
-
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
210
|
-
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
|
|
211
|
-
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret, orderColumn }))
|
|
218
|
+
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
219
|
+
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret, lang }))
|
|
220
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret, orderColumn, lang }))
|
|
212
221
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
213
222
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
214
223
|
},
|
|
215
224
|
fetchOtherRewardList: async (context, event) => {
|
|
216
225
|
const orderColumn = context.orderColumn
|
|
217
|
-
|
|
226
|
+
const lang = context.lang
|
|
218
227
|
const getOtherRewardAPI = request.send(
|
|
219
228
|
activity.getRewardList({
|
|
220
229
|
rewardType: 'CASH,FREE,PRIZE',
|
|
221
230
|
count: 30,
|
|
222
231
|
appSecret,
|
|
223
232
|
orderColumn,
|
|
233
|
+
lang,
|
|
224
234
|
})
|
|
225
235
|
)
|
|
226
236
|
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
@@ -2,7 +2,7 @@ import { createMachine, assign, send } from 'xstate'
|
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
import payment from '../api/payment.js'
|
|
4
4
|
|
|
5
|
-
export default function (request) {
|
|
5
|
+
export default function (request, context) {
|
|
6
6
|
const { appSecret } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
@@ -18,6 +18,7 @@ export default function (request) {
|
|
|
18
18
|
withdrawRule: {},
|
|
19
19
|
callback: () => {},
|
|
20
20
|
orderColumn: 'createTime',
|
|
21
|
+
lang: context?.locale,
|
|
21
22
|
},
|
|
22
23
|
states: {
|
|
23
24
|
timer: {
|
|
@@ -78,6 +79,9 @@ export default function (request) {
|
|
|
78
79
|
target: 'allPointsReceiving',
|
|
79
80
|
actions: 'setCallback',
|
|
80
81
|
},
|
|
82
|
+
SET_LANG: {
|
|
83
|
+
actions: 'setLang',
|
|
84
|
+
},
|
|
81
85
|
},
|
|
82
86
|
},
|
|
83
87
|
fetching: {
|
|
@@ -201,16 +205,22 @@ export default function (request) {
|
|
|
201
205
|
withdrawRule: event.data,
|
|
202
206
|
}
|
|
203
207
|
}),
|
|
208
|
+
setLang: assign((context, event) => {
|
|
209
|
+
const lang = event.data.locale || context.lang || 'en-US'
|
|
210
|
+
return { lang }
|
|
211
|
+
}),
|
|
204
212
|
},
|
|
205
213
|
services: {
|
|
206
214
|
fetchRewardList: async (context, event) => {
|
|
207
|
-
const
|
|
215
|
+
const lang = context.lang
|
|
216
|
+
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret, lang }))
|
|
208
217
|
const orderColumn = context.orderColumn
|
|
209
218
|
const getPointsRewardAPI = request.send(
|
|
210
219
|
activity.getRewardList({
|
|
211
220
|
rewardType: 'POINTS',
|
|
212
221
|
count: 30,
|
|
213
222
|
appSecret,
|
|
223
|
+
lang,
|
|
214
224
|
})
|
|
215
225
|
)
|
|
216
226
|
const getOtherRewardAPI = request.send(
|
|
@@ -219,6 +229,7 @@ export default function (request) {
|
|
|
219
229
|
count: 30,
|
|
220
230
|
appSecret,
|
|
221
231
|
orderColumn,
|
|
232
|
+
lang,
|
|
222
233
|
})
|
|
223
234
|
)
|
|
224
235
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
@@ -226,13 +237,14 @@ export default function (request) {
|
|
|
226
237
|
},
|
|
227
238
|
fetchOtherRewardList: async (context, event) => {
|
|
228
239
|
const orderColumn = context.orderColumn
|
|
229
|
-
|
|
240
|
+
const lang = context.lang
|
|
230
241
|
const getOtherRewardAPI = request.send(
|
|
231
242
|
activity.getRewardList({
|
|
232
243
|
rewardType: 'CASH,FREE,PRIZE',
|
|
233
244
|
count: 30,
|
|
234
245
|
appSecret,
|
|
235
246
|
orderColumn,
|
|
247
|
+
lang,
|
|
236
248
|
})
|
|
237
249
|
)
|
|
238
250
|
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
package/src/machine/vip_table.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
export default function (request) {
|
|
4
|
+
const { appSecret } = request.config
|
|
4
5
|
return createMachine(
|
|
5
6
|
{
|
|
6
7
|
id: 'vip_table',
|
|
@@ -35,14 +36,20 @@ export default function (request) {
|
|
|
35
36
|
},
|
|
36
37
|
services: {
|
|
37
38
|
fetchVipTable: async (context, event) => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const result = await request.send(activity.getVipTable({ appSecret }))
|
|
40
|
+
let dataList = []
|
|
41
|
+
// V2接口轉換中回傳的資料結構不同
|
|
42
|
+
if (!result?.viptable) {
|
|
43
|
+
dataList = result.data
|
|
44
|
+
} else {
|
|
45
|
+
dataList = result.viptable?.data
|
|
46
|
+
}
|
|
47
|
+
dataList.map((item) => {
|
|
41
48
|
item.title = item.title.toLowerCase()
|
|
42
49
|
return item
|
|
43
50
|
})
|
|
44
51
|
|
|
45
|
-
return
|
|
52
|
+
return dataList
|
|
46
53
|
},
|
|
47
54
|
},
|
|
48
55
|
}
|
package/src/request/request.js
CHANGED
|
@@ -2,6 +2,139 @@ import pickBy from 'lodash/pickBy.js'
|
|
|
2
2
|
import storage from '../util/storage.js'
|
|
3
3
|
|
|
4
4
|
// const pickBy = require('lodash/pickBy')
|
|
5
|
+
const supportVersion2List = [
|
|
6
|
+
// 04-09 Update
|
|
7
|
+
'game/play',
|
|
8
|
+
'game/gameReplay',
|
|
9
|
+
'game/logout',
|
|
10
|
+
'game/list/v3/root',
|
|
11
|
+
'game/list/v3/category',
|
|
12
|
+
'game/list/v3/addition',
|
|
13
|
+
'game/list/v3/categoryByRange',
|
|
14
|
+
'game/list/v3/additionByRange',
|
|
15
|
+
'game/list/v3/myFavorite',
|
|
16
|
+
'game/list/v3/addMyFavorite',
|
|
17
|
+
'game/list/v3/removeMyFavorite',
|
|
18
|
+
'login',
|
|
19
|
+
'callback/:strategy',
|
|
20
|
+
'guestLogin',
|
|
21
|
+
'appLogin',
|
|
22
|
+
'logout',
|
|
23
|
+
'self',
|
|
24
|
+
'register',
|
|
25
|
+
'settings/password',
|
|
26
|
+
'verify',
|
|
27
|
+
'reset',
|
|
28
|
+
'acknowledge',
|
|
29
|
+
'recovery',
|
|
30
|
+
'recovery/abandon',
|
|
31
|
+
'recovery/acknowledge',
|
|
32
|
+
'checkDt',
|
|
33
|
+
'updateDt',
|
|
34
|
+
'checkAC',
|
|
35
|
+
'checkAccount',
|
|
36
|
+
'getAllAvatar',
|
|
37
|
+
'updateUserAvatar',
|
|
38
|
+
'getConfig',
|
|
39
|
+
'getQuickLayout',
|
|
40
|
+
'getNavbarSetting',
|
|
41
|
+
'getAffiliateCode',
|
|
42
|
+
'get-site-config',
|
|
43
|
+
'mailbox/sendMessage',
|
|
44
|
+
'mailbox/getMessageList',
|
|
45
|
+
'mailbox/getMessage',
|
|
46
|
+
'mailbox/updateMessage',
|
|
47
|
+
'mailbox/getMessageTypes',
|
|
48
|
+
// 05-23 Update
|
|
49
|
+
'game/info',
|
|
50
|
+
'recovery/v2/initiate',
|
|
51
|
+
'recovery/v2/acknowledge',
|
|
52
|
+
'recovery/v2/abandon',
|
|
53
|
+
'recovery/v2/reset',
|
|
54
|
+
'recovery/v2/changePassword',
|
|
55
|
+
'account-binding/status',
|
|
56
|
+
'account-binding/bind',
|
|
57
|
+
'account-binding/acknowledge',
|
|
58
|
+
'account-binding/bind-third-party',
|
|
59
|
+
'feeds',
|
|
60
|
+
'broadcast',
|
|
61
|
+
'upload',
|
|
62
|
+
'game/search',
|
|
63
|
+
'game/search/home',
|
|
64
|
+
'game/search/list',
|
|
65
|
+
'game/search/trace',
|
|
66
|
+
'game/history',
|
|
67
|
+
'game/history/detail',
|
|
68
|
+
'payment/v2/bankWallet/promotion/apply',
|
|
69
|
+
'payment/v2/bankWallet/promotion/giveUp',
|
|
70
|
+
'payment/v2/bankWallet/promotion/preview',
|
|
71
|
+
'payment/v2/bankWallet/promotions',
|
|
72
|
+
'payment/v2/bankWallet/restore',
|
|
73
|
+
'payment/v2/callback',
|
|
74
|
+
'payment/v2/convertFreeCredit',
|
|
75
|
+
'payment/v2/getBindingBankList',
|
|
76
|
+
'payment/v2/getBindingPaymentList',
|
|
77
|
+
'payment/v2/getWithdrawBankList',
|
|
78
|
+
'payment/v2/getCurrentWithdrawRule',
|
|
79
|
+
'payment/v2/withdrawCheck',
|
|
80
|
+
'payment/v2/history',
|
|
81
|
+
'payment/v2/mergeWallet',
|
|
82
|
+
'payment/v2/paymentDetail',
|
|
83
|
+
'payment/v2/category/options',
|
|
84
|
+
'payment/v2/paymentInfo',
|
|
85
|
+
'payment/v2/getBindingPaymentInfo',
|
|
86
|
+
'payment/v2/pendingOrder',
|
|
87
|
+
'payment/v2/promotions',
|
|
88
|
+
'payment/v2/spotmarket',
|
|
89
|
+
'payment/v2/transactionHistory',
|
|
90
|
+
'payment/v2/updateUtr',
|
|
91
|
+
'payment/v2/setting',
|
|
92
|
+
'payment/v2/amb/setting',
|
|
93
|
+
'payment/v2/updatePaymentInfo',
|
|
94
|
+
'payment/v2/uploadSlip',
|
|
95
|
+
'payment/v2/withdrawRule',
|
|
96
|
+
'payment/v2/:paymentType/getBankList',
|
|
97
|
+
'payment/v2/:paymentType/transaction',
|
|
98
|
+
'payment/v2/:paymentType/checkTransaction',
|
|
99
|
+
'payment/v2/:paymentType/bonus/preview',
|
|
100
|
+
'payment/v2/:paymentType/expected/result',
|
|
101
|
+
'payment/v2/:paymentType/crypto/expected/result',
|
|
102
|
+
// 05-28 Update
|
|
103
|
+
'all-activities/list',
|
|
104
|
+
'activities/list',
|
|
105
|
+
'activities/rewards',
|
|
106
|
+
'activities/rewardAmount',
|
|
107
|
+
'activities/sentAward',
|
|
108
|
+
'activities/exchange',
|
|
109
|
+
'activities/collect',
|
|
110
|
+
'activities',
|
|
111
|
+
'activities/types',
|
|
112
|
+
'activities/promo',
|
|
113
|
+
'activities/viptable',
|
|
114
|
+
'activities/numbers',
|
|
115
|
+
'activities/honorBroadcast',
|
|
116
|
+
'activities/exchange/diamond/max-amount',
|
|
117
|
+
'activities/exchange/diamond/settle',
|
|
118
|
+
'tournament/detail',
|
|
119
|
+
'ranking/detail',
|
|
120
|
+
'ranking/detail/option',
|
|
121
|
+
'hot-game/ranking',
|
|
122
|
+
'activities/getFreeGameReward',
|
|
123
|
+
'activities/getFreeGameRewardList',
|
|
124
|
+
'activities/rebate/estimate',
|
|
125
|
+
'activities/rebate/collect',
|
|
126
|
+
'activities/rebate/history',
|
|
127
|
+
'activities/lose-rebate/history',
|
|
128
|
+
'friends',
|
|
129
|
+
'friends/home',
|
|
130
|
+
'friends/reward-list',
|
|
131
|
+
'friends/dashboard',
|
|
132
|
+
'friends/dashboard/list',
|
|
133
|
+
'activities/ranking',
|
|
134
|
+
'activities/activity/ranking',
|
|
135
|
+
'activities/cashRain',
|
|
136
|
+
'activities/jackpot/list',
|
|
137
|
+
]
|
|
5
138
|
|
|
6
139
|
function isValid(value) {
|
|
7
140
|
return value !== undefined && value !== null
|
|
@@ -24,7 +157,8 @@ export default class Request {
|
|
|
24
157
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
|
|
25
158
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform
|
|
26
159
|
if (this.getToken()) {
|
|
27
|
-
|
|
160
|
+
// 為了支援V2版本的API接口新增Bearer來進行身份驗證
|
|
161
|
+
axiosConfig.headers.Authorization = `Bearer ${this.getToken()}`
|
|
28
162
|
}
|
|
29
163
|
return axiosConfig
|
|
30
164
|
})
|
|
@@ -85,11 +219,34 @@ export default class Request {
|
|
|
85
219
|
|
|
86
220
|
_createConfig(req, cancelToken) {
|
|
87
221
|
const { method, url, params, isPublic, isFormData, headers } = req
|
|
222
|
+
let fullURL = this.config.fullURL
|
|
223
|
+
let urlName = url
|
|
224
|
+
// 有些API會將參數(/?)直接帶在URL上,所以要將參數排除
|
|
225
|
+
const cleanUrl = url.split('?')[0]
|
|
226
|
+
|
|
227
|
+
const isV2Supported = supportVersion2List.some((supportedUrl) => {
|
|
228
|
+
// 如果包含動態參數(:parameter),則使用模式匹配
|
|
229
|
+
if (supportedUrl.includes(':')) {
|
|
230
|
+
const pattern = supportedUrl.replace(/:[^/]+/g, '[^/]+')
|
|
231
|
+
const regex = new RegExp(`^${pattern}$`)
|
|
232
|
+
return regex.test(cleanUrl)
|
|
233
|
+
}
|
|
234
|
+
return supportedUrl === cleanUrl
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
if (isV2Supported) {
|
|
238
|
+
fullURL = fullURL.replace('/v1/', '/v2/')
|
|
239
|
+
urlName = this._convertUrlToKebabCase(url)
|
|
240
|
+
console.log(`*[DEV_ONLY]V2`, 'url:', urlName)
|
|
241
|
+
} else {
|
|
242
|
+
console.log(`*[DEV_ONLY]V2-不支援:`, 'url:', urlName)
|
|
243
|
+
}
|
|
244
|
+
|
|
88
245
|
if (isFormData) {
|
|
89
246
|
return {
|
|
90
|
-
baseURL:
|
|
247
|
+
baseURL: fullURL,
|
|
91
248
|
method,
|
|
92
|
-
url,
|
|
249
|
+
url: urlName,
|
|
93
250
|
cancelToken,
|
|
94
251
|
isPublic,
|
|
95
252
|
headers: { 'Content-Type': 'multipart/form-data' },
|
|
@@ -97,9 +254,9 @@ export default class Request {
|
|
|
97
254
|
}
|
|
98
255
|
} else {
|
|
99
256
|
return {
|
|
100
|
-
baseURL:
|
|
257
|
+
baseURL: fullURL,
|
|
101
258
|
method,
|
|
102
|
-
url,
|
|
259
|
+
url: urlName,
|
|
103
260
|
cancelToken,
|
|
104
261
|
isPublic,
|
|
105
262
|
headers,
|
|
@@ -108,6 +265,38 @@ export default class Request {
|
|
|
108
265
|
}
|
|
109
266
|
}
|
|
110
267
|
|
|
268
|
+
// 調整API路徑與名稱
|
|
269
|
+
_convertUrlToKebabCase(url) {
|
|
270
|
+
const specifyingPath = {
|
|
271
|
+
'all-activities/list': 'activities/all-activities-list',
|
|
272
|
+
friends: 'activities/friends',
|
|
273
|
+
'friends/home': 'activities/friends/home',
|
|
274
|
+
'friends/reward-list': 'activities/friends/reward-list',
|
|
275
|
+
'friends/dashboard': 'activities/friends/dashboard',
|
|
276
|
+
'friends/dashboard/list': 'activities/friends/dashboard/list',
|
|
277
|
+
'activities/getFreeGameReward': 'activities/free-game/get-free-game-reward',
|
|
278
|
+
'activities/getFreeGameRewardList': 'activities/free-game/get-free-game-reward-list',
|
|
279
|
+
'activities/lose-rebate/history': 'activities/rebate/lose-rebate/history',
|
|
280
|
+
'activities/ranking': 'activities/ranking/promotion-ranking',
|
|
281
|
+
'activities/activity/ranking': 'activities/ranking/basic-ranking',
|
|
282
|
+
'activities/cashRain': 'activities/cash-rain/exchange',
|
|
283
|
+
'tournament/detail': 'activities/tournament/detail',
|
|
284
|
+
'ranking/detail': 'activities/tournament/ranking/detail',
|
|
285
|
+
'ranking/detail/option': 'activities/tournament/ranking/detail/option',
|
|
286
|
+
'hot-game/ranking': 'activities/tournament/ranking/hot-game',
|
|
287
|
+
'activities/rebate/estimate': 'activities/rebate/estimate',
|
|
288
|
+
'activities/exchange/diamond/max-amount': 'activities/diamond/exchange/max-amount',
|
|
289
|
+
'activities/exchange/diamond/settle': 'activities/diamond/exchange/settle',
|
|
290
|
+
}
|
|
291
|
+
if (specifyingPath[url]) {
|
|
292
|
+
// 和原有路徑不同有另外改路徑
|
|
293
|
+
return specifyingPath[url]
|
|
294
|
+
} else {
|
|
295
|
+
// 將API_URL的命名規則由駝峰調整為短橫線(-)
|
|
296
|
+
return url.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
111
300
|
_checkToken(req) {
|
|
112
301
|
if (!req.isPublic && !this.getToken()) {
|
|
113
302
|
throw { code: 'ERR_A103', url: req.url }
|