@jetthai/cuora 1.1.488-dev.1 → 1.2.0
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/.husky/pre-commit +3 -1
- package/.prettierignore +1 -2
- package/CHANGELOG.md +0 -746
- package/README.md +15 -299
- package/package.json +3 -6
- package/resetGitBranch.sh +101 -0
- package/src/api/activity.js +39 -24
- package/src/api/auth.js +35 -4
- package/src/api/common.js +1 -8
- package/src/api/game.js +10 -0
- package/src/api/index.js +1 -3
- package/src/api/payment.js +55 -18
- package/src/api/user.js +16 -11
- package/src/index.js +2 -2
- package/src/lib/fingerprint_v3_11_12.js +11433 -0
- package/src/machine/activity/activity.js +209 -0
- package/src/machine/activity/activity_cash.js +18 -71
- package/src/machine/activity/diamond_shop_activity_cash.js +1 -0
- package/src/machine/activity/diamond_shop_activity_fc.js +196 -0
- package/src/machine/activity/diamond_shop_activity_vn.js +178 -0
- package/src/machine/activity/fafafa_activity.js +10 -0
- package/src/machine/activity/index.js +12 -0
- package/src/machine/activity/invite_friends_activity.js +114 -0
- package/src/machine/activity/mini_game_activity.js +68 -0
- package/src/machine/activity/return_bonus_activity.js +153 -0
- package/src/machine/activity/roulette_activity_v2.js +0 -5
- package/src/machine/auth.js +140 -192
- package/src/machine/auth_otp_v2.js +177 -0
- package/src/machine/auth_otp_v3.js +32 -111
- package/src/machine/bank_binding.js +2 -2
- package/src/machine/bank_binding_amb.js +145 -0
- package/src/machine/bonus.js +75 -0
- package/src/machine/common.js +91 -27
- package/src/machine/deposit/amb.js +92 -0
- package/src/machine/deposit/crypto_bank.js +325 -0
- package/src/machine/deposit/crypto_bank_cash.js +8 -19
- package/src/machine/deposit/crypto_qrcode.js +148 -0
- package/src/machine/deposit/crypto_qrcode_cash.js +41 -26
- package/src/machine/deposit/crypto_way.js +247 -0
- package/src/machine/deposit/crypto_way_cash.js +32 -52
- package/src/machine/deposit/deposit_fc.js +271 -0
- package/src/machine/deposit/direct.js +310 -0
- package/src/machine/deposit/direct_cash.js +9 -8
- package/src/machine/deposit/float.js +374 -0
- package/src/machine/deposit/index.js +28 -0
- package/src/machine/deposit/krway.js +151 -0
- package/src/machine/deposit/loadcard_cash.js +31 -14
- package/src/machine/deposit/loadcard_vn.js +351 -0
- package/src/machine/deposit/manual_cash.js +10 -8
- package/src/machine/deposit/manual_vn.js +458 -0
- package/src/machine/deposit/qrcode_cash.js +30 -14
- package/src/machine/deposit/qrcode_v2.js +338 -0
- package/src/machine/deposit/usdt.js +144 -0
- package/src/machine/deposit/virtual_bank_cash.js +2 -5
- package/src/machine/deposit/virtual_bank_vn.js +269 -0
- package/src/machine/deposit/vpay.js +367 -0
- package/src/machine/error.js +0 -7
- package/src/machine/game_hot_new.js +79 -0
- package/src/machine/game_info.js +12 -5
- package/src/machine/game_replay.js +46 -0
- package/src/machine/game_search_v2.js +401 -0
- package/src/machine/game_v2_1.js +88 -58
- package/src/machine/honor_board.js +132 -0
- package/src/machine/honor_board_cash.js +18 -15
- package/src/machine/inbox.js +12 -0
- package/src/machine/index.js +32 -0
- package/src/machine/leaderboard.js +11 -8
- package/src/machine/merge.js +57 -0
- package/src/machine/payment_data.js +86 -0
- package/src/machine/promotions.js +170 -0
- package/src/machine/ranking.js +25 -43
- package/src/machine/reward.js +255 -0
- package/src/machine/reward_cash.js +41 -2
- package/src/machine/reward_fc.js +98 -0
- package/src/machine/roulette_v2.js +25 -20
- package/src/machine/side.js +154 -0
- package/src/machine/side_cash.js +2 -3
- package/src/machine/side_v2.js +209 -0
- package/src/machine/user_reset_password.js +15 -4
- package/src/machine/user_sign_up.js +60 -49
- package/src/machine/vip_table.js +57 -0
- package/src/machine/websocket.js +325 -378
- package/src/machine/welcome.js +110 -0
- package/src/machine/withdraw/index.js +6 -0
- package/src/machine/withdraw/withdraw_crypto_cash.js +327 -0
- package/src/machine/withdraw/withdraw_krway.js +222 -0
- package/src/machine/withdraw/withdraw_manual.js +533 -0
- package/src/machine/withdraw/withdraw_manual_cash.js +43 -74
- package/src/request/config.js +0 -2
- package/src/request/request.js +64 -231
- package/src/util/constant.js +2 -12
- package/src/util/deviceToken.js +59 -0
- package/src/util/index.js +4 -2
- package/src/util/math.js +4 -0
- package/.claude/commands/sync-ai-prompts.md +0 -180
- package/.claude/settings.local.json +0 -25
- package/.github/copilot-instructions.md +0 -459
- package/.husky/post-checkout +0 -32
- package/.husky/pre-push +0 -36
- package/AGENTS.md +0 -459
- package/AI_PROMPT_SOURCE.md +0 -457
- package/CLAUDE.md +0 -459
- package/GEMINI.md +0 -459
- 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/docs/my-claude/feat-sharon-JT-1790247240-socket/branch-transfer.md +0 -14
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/cash-module-preparation.json +0 -40
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/cash-module-verification.md +0 -41
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/implementation-ledger.md +0 -87
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/module-report.md +0 -73
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/plan.md +0 -309
- package/docs/my-claude/feat-sharon-JT-1790247240-socket/test-cases.md +0 -245
- package/docs/my-claude/feat-sharon-JT-1791180540-onesignal/transfer.md +0 -9
- package/e2e/feature-map.md +0 -19
- package/prepare-for-pr/JT-1776243420.md +0 -85
- package/prepare-for-pr/TI-16026/STATE.md +0 -18
- package/prepare-for-pr/TI-16026/after-prepare-authorization.md +0 -3
- package/prepare-for-pr/TI-16026/analysis.md +0 -38
- package/prepare-for-pr/TI-16026/answer-analyze-01.md +0 -1
- package/prepare-for-pr/TI-16026/answer-commit-01.md +0 -2
- package/prepare-for-pr/TI-16026/answer-commit-02.md +0 -1
- package/prepare-for-pr/TI-16026/bundle.json +0 -18
- package/prepare-for-pr/TI-16026/checklist.md +0 -196
- package/prepare-for-pr/TI-16026/checklist.unit-test-original.md +0 -39
- package/prepare-for-pr/TI-16026/claude-after-model +0 -1
- package/prepare-for-pr/TI-16026/claude-commit-session +0 -1
- package/prepare-for-pr/TI-16026/claude-harvest-session +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/01-analyze.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/01-analyze.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/02-analyze.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/02-analyze.out +0 -4
- package/prepare-for-pr/TI-16026/claude-hops/03-dev.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/03-dev.out +0 -4
- package/prepare-for-pr/TI-16026/claude-hops/04-dev.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/04-dev.out +0 -4
- package/prepare-for-pr/TI-16026/claude-hops/05-dev.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/05-dev.out +0 -3
- package/prepare-for-pr/TI-16026/claude-hops/06-after.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/06-after.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/07-commit.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/07-commit.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/08-commit.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/08-commit.out +0 -2
- package/prepare-for-pr/TI-16026/claude-hops/09-commit.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/09-commit.out +0 -8
- package/prepare-for-pr/TI-16026/claude-hops/10-harvest.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/10-harvest.out +0 -3
- package/prepare-for-pr/TI-16026/claude-hops/11-harvest.err +0 -1
- package/prepare-for-pr/TI-16026/claude-hops/11-harvest.out +0 -3
- package/prepare-for-pr/TI-16026/commit-note.md +0 -5
- package/prepare-for-pr/TI-16026/evidence-index.json +0 -215
- package/prepare-for-pr/TI-16026/feature-map.before.md +0 -61
- package/prepare-for-pr/TI-16026/harvest-redaction.json +0 -34
- package/prepare-for-pr/TI-16026/harvest-redaction.out +0 -37
- package/prepare-for-pr/TI-16026/harvest.md +0 -46
- package/prepare-for-pr/TI-16026/lessons.md +0 -5
- package/prepare-for-pr/TI-16026/note-harvest-redaction.md +0 -1
- package/prepare-for-pr/TI-16026/open-questions.md +0 -6
- package/prepare-for-pr/TI-16026/publish.md +0 -32
- package/prepare-for-pr/TI-16026/review-convergence-response.md +0 -3
- package/prepare-for-pr/TI-16026/review-input/scope.md +0 -18
- package/prepare-for-pr/TI-16026/review-log.md +0 -57
- package/prepare-for-pr/TI-16026/review-notes.md +0 -97
- package/prepare-for-pr/TI-16026/review-response-r1.md +0 -7
- package/prepare-for-pr/TI-16026/self-test-report.md +0 -67
- package/prepare-for-pr/TI-16026/spec-proposal.md +0 -34
- package/prepare-for-pr/TI-16026/spec-snapshot.md +0 -291
- package/prepare-for-pr/TI-16026/state-log.md +0 -57
- package/prepare-for-pr/TI-16026/user-messages/01.md +0 -12
- package/prepare-for-pr/TI-16026/user-messages/02.md +0 -20
- package/prepare-for-pr/TI-16026/user-messages/03.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/04.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/05.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/06.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/07.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/08.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/09.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/10.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/11.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/12.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/13.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/14.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/15.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/16.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/17.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/18.md +0 -10
- package/prepare-for-pr/TI-16026/user-messages/19.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/20.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/21.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/22.md +0 -1
- package/prepare-for-pr/TI-16026/user-messages/23.md +0 -8
- package/prepare-for-pr/TI-16026/user-messages/24.md +0 -24
- package/prepare-for-pr/TI-16026/user-question.md +0 -24
- package/prepare-for-pr/TI-16026/verify/metrics-check.json +0 -13
- package/prepare-for-pr/TI-16026/verify/redaction.json +0 -38
- package/prepare-for-pr/TI-16026/verify/row-closure.json +0 -45
- package/prepare-for-pr/TI-16026/verify/s04-ws-capture.md +0 -23
- package/prepare-for-pr/TI-16026/verify-after.md +0 -23
- package/prepare-for-pr/TI-16026/verify.json +0 -80
- package/prepare-for-pr/TI-16026.md +0 -408
- package/scripts/auto-version.js +0 -69
- package/scripts/auto-version.sh +0 -33
- package/scripts/branch-auto-npm-publish.js +0 -36
- package/scripts/check-version.sh +0 -36
- package/scripts/clean-tags.sh +0 -84
- package/src/api/account.js +0 -7
- package/src/api/otp.js +0 -5
- package/src/util/amount.js +0 -8
- package/src/util/err998SentryExtra.js +0 -26
- package/src/util/paramStore.js +0 -139
- package/src/util/socketPolicy.js +0 -57
- package/src/util/tokenStore.js +0 -44
- package/test/auth_otp_v3.test.js +0 -323
- package/test/auth_self_timeout.test.js +0 -171
- package/test/request_self.test.js +0 -288
- package/test/withdraw_manual_cash.test.js +0 -149
- package/tests/session.test.mjs +0 -177
- package/tests/websocket.test.mjs +0 -779
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import auth from '../api/auth.js'
|
|
3
|
+
import { getDeviceTokenWithRetry } from '../util/deviceToken.js'
|
|
3
4
|
import storage from '../util/storage.js'
|
|
4
|
-
import { readParamFromLocation, normalize, AC_KEYS, FC_KEYS } from '../util/paramStore.js'
|
|
5
|
-
|
|
6
|
-
// 註冊強制綁定多型出款:轉發各綁定型別欄位(BANK / CRYPTO / EWALLET),只帶有值的欄位
|
|
7
|
-
const BIND_FIELDS = [
|
|
8
|
-
'bindingType',
|
|
9
|
-
'cryptoCurrency',
|
|
10
|
-
'cryptoNetwork',
|
|
11
|
-
'cryptoAddress',
|
|
12
|
-
'walletCode',
|
|
13
|
-
'ifscCode',
|
|
14
|
-
'pixType',
|
|
15
|
-
'firstNameLocale',
|
|
16
|
-
'lastNameLocale',
|
|
17
|
-
]
|
|
18
|
-
const pickBindData = (data = {}) => BIND_FIELDS.reduce((acc, key) => (data[key] !== undefined ? { ...acc, [key]: data[key] } : acc), {})
|
|
19
5
|
|
|
20
6
|
export default function (request) {
|
|
21
|
-
const { sentry } = request.config
|
|
7
|
+
const { fpToken, sentry, defaultChannel, defaultSubchannel } = request.config
|
|
22
8
|
return createMachine(
|
|
23
9
|
{
|
|
24
10
|
id: 'user_sign_up',
|
|
25
11
|
initial: 'idle',
|
|
26
12
|
context: {
|
|
27
13
|
provider: null,
|
|
14
|
+
channel: null,
|
|
15
|
+
subchannel: null,
|
|
28
16
|
signUpData: {},
|
|
29
17
|
fc: null,
|
|
30
18
|
reCaptchaToken: null,
|
|
@@ -34,7 +22,6 @@ export default function (request) {
|
|
|
34
22
|
site: null,
|
|
35
23
|
strategy: null,
|
|
36
24
|
uid: null,
|
|
37
|
-
agentId: null,
|
|
38
25
|
},
|
|
39
26
|
deviceTokenEnable: true,
|
|
40
27
|
},
|
|
@@ -85,8 +72,7 @@ export default function (request) {
|
|
|
85
72
|
}),
|
|
86
73
|
setFriendCode: assign((context, event) => {
|
|
87
74
|
const { fc } = event.data
|
|
88
|
-
|
|
89
|
-
return { fc: normalize(fc) }
|
|
75
|
+
return { fc }
|
|
90
76
|
}),
|
|
91
77
|
setSignUpId: assign((context, event) => {
|
|
92
78
|
const {
|
|
@@ -96,20 +82,18 @@ export default function (request) {
|
|
|
96
82
|
password,
|
|
97
83
|
countryCode,
|
|
98
84
|
phone,
|
|
85
|
+
channel,
|
|
86
|
+
subchannel,
|
|
99
87
|
bankCode,
|
|
100
88
|
bankAccount,
|
|
101
89
|
holderName,
|
|
102
90
|
branch,
|
|
103
91
|
branchCode,
|
|
104
92
|
affiliateCode,
|
|
105
|
-
birthday,
|
|
106
93
|
} = event.data
|
|
107
94
|
return {
|
|
108
95
|
signUpData: {
|
|
109
96
|
provider: 'local',
|
|
110
|
-
birthday,
|
|
111
|
-
...pickBindData(event.data),
|
|
112
|
-
birthday,
|
|
113
97
|
email,
|
|
114
98
|
username,
|
|
115
99
|
nick_name,
|
|
@@ -123,17 +107,29 @@ export default function (request) {
|
|
|
123
107
|
branchCode,
|
|
124
108
|
affiliateCode,
|
|
125
109
|
},
|
|
110
|
+
channel,
|
|
111
|
+
subchannel,
|
|
126
112
|
}
|
|
127
113
|
}),
|
|
128
114
|
setSignUpPhone: assign((context, event) => {
|
|
129
|
-
const {
|
|
130
|
-
|
|
115
|
+
const {
|
|
116
|
+
email,
|
|
117
|
+
countryCode,
|
|
118
|
+
phone,
|
|
119
|
+
nick_name,
|
|
120
|
+
password,
|
|
121
|
+
channel,
|
|
122
|
+
subchannel,
|
|
123
|
+
bankCode,
|
|
124
|
+
bankAccount,
|
|
125
|
+
holderName,
|
|
126
|
+
branch,
|
|
127
|
+
branchCode,
|
|
128
|
+
affiliateCode,
|
|
129
|
+
} = event.data
|
|
131
130
|
return {
|
|
132
131
|
signUpData: {
|
|
133
132
|
provider: 'phone',
|
|
134
|
-
birthday,
|
|
135
|
-
...pickBindData(event.data),
|
|
136
|
-
birthday,
|
|
137
133
|
email,
|
|
138
134
|
countryCode,
|
|
139
135
|
phone,
|
|
@@ -146,17 +142,29 @@ export default function (request) {
|
|
|
146
142
|
branchCode,
|
|
147
143
|
affiliateCode,
|
|
148
144
|
},
|
|
145
|
+
channel,
|
|
146
|
+
subchannel,
|
|
149
147
|
}
|
|
150
148
|
}),
|
|
151
149
|
setSignUpEmail: assign((context, event) => {
|
|
152
|
-
const {
|
|
153
|
-
|
|
150
|
+
const {
|
|
151
|
+
email,
|
|
152
|
+
nick_name,
|
|
153
|
+
password,
|
|
154
|
+
channel,
|
|
155
|
+
subchannel,
|
|
156
|
+
bankCode,
|
|
157
|
+
bankAccount,
|
|
158
|
+
holderName,
|
|
159
|
+
branch,
|
|
160
|
+
branchCode,
|
|
161
|
+
affiliateCode,
|
|
162
|
+
countryCode,
|
|
163
|
+
phone,
|
|
164
|
+
} = event.data
|
|
154
165
|
return {
|
|
155
166
|
signUpData: {
|
|
156
167
|
provider: 'email',
|
|
157
|
-
birthday,
|
|
158
|
-
...pickBindData(event.data),
|
|
159
|
-
birthday,
|
|
160
168
|
email,
|
|
161
169
|
nick_name,
|
|
162
170
|
password,
|
|
@@ -169,10 +177,12 @@ export default function (request) {
|
|
|
169
177
|
countryCode,
|
|
170
178
|
phone,
|
|
171
179
|
},
|
|
180
|
+
channel,
|
|
181
|
+
subchannel,
|
|
172
182
|
}
|
|
173
183
|
}),
|
|
174
184
|
setRegistrationData: assign((context, event) => {
|
|
175
|
-
const { account, currency, site, strategy, uid,
|
|
185
|
+
const { account, currency, site, strategy, uid, channel, sub_channel } = event.data
|
|
176
186
|
return {
|
|
177
187
|
registrationData: {
|
|
178
188
|
account,
|
|
@@ -180,7 +190,8 @@ export default function (request) {
|
|
|
180
190
|
site,
|
|
181
191
|
strategy,
|
|
182
192
|
uid,
|
|
183
|
-
|
|
193
|
+
channel,
|
|
194
|
+
sub_channel,
|
|
184
195
|
},
|
|
185
196
|
}
|
|
186
197
|
}),
|
|
@@ -192,36 +203,36 @@ export default function (request) {
|
|
|
192
203
|
},
|
|
193
204
|
services: {
|
|
194
205
|
authenticate: async (context, event) => {
|
|
195
|
-
const { signUpData, deviceTokenEnable } = context
|
|
196
|
-
const dt =
|
|
206
|
+
const { channel, subchannel, signUpData, deviceTokenEnable } = context
|
|
207
|
+
const dt = await getDeviceTokenWithRetry({ fpToken, sentry, hosts: request.hosts, enable: deviceTokenEnable })
|
|
197
208
|
|
|
198
|
-
|
|
199
|
-
// 判定用 `!== undefined` 而非 hasOwnProperty:上面的 setSignUpId/Phone/Email 是以解構寫入
|
|
200
|
-
// signUpData,宿主沒帶時 key 仍然存在(值為 undefined),hasOwnProperty 會恆為 true、
|
|
201
|
-
// 讓三層解析變成死碼。也不能用 `||`,否則使用者刻意清空送出的空字串會被吃掉、
|
|
202
|
-
// 退回三層解析把剛清掉的舊代理碼從網址撿回來。
|
|
203
|
-
const { affiliateCode: explicitAffiliateCode, ...signUpRest } = signUpData || {}
|
|
204
|
-
const hasExplicitAc = explicitAffiliateCode !== undefined
|
|
205
|
-
const acRead = readParamFromLocation(AC_KEYS)
|
|
206
|
-
const affiliateCode = hasExplicitAc ? normalize(explicitAffiliateCode) : acRead.value
|
|
209
|
+
const affiliateCode = storage.get('ac') || signUpData?.affiliateCode
|
|
207
210
|
const messages = {
|
|
208
211
|
url: window.location.href,
|
|
212
|
+
channelOrders: [
|
|
213
|
+
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
214
|
+
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
215
|
+
{ channel: channel, subchannel: subchannel },
|
|
216
|
+
],
|
|
209
217
|
affiliateCode,
|
|
210
|
-
acSource: hasExplicitAc ? 'signUpData' : acRead.from,
|
|
211
218
|
}
|
|
219
|
+
sentry.captureMessage(JSON.stringify(messages))
|
|
212
220
|
|
|
213
221
|
const referralObj = {}
|
|
214
222
|
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
215
223
|
referralObj.ac = affiliateCode
|
|
216
224
|
}
|
|
217
225
|
|
|
226
|
+
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
227
|
+
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
228
|
+
|
|
218
229
|
return await request.send(
|
|
219
230
|
auth.register({
|
|
220
|
-
...
|
|
231
|
+
...signUpData,
|
|
221
232
|
...referralObj,
|
|
222
233
|
dt,
|
|
223
234
|
reCaptchaToken: context.reCaptchaToken,
|
|
224
|
-
fc: context.fc
|
|
235
|
+
fc: context.fc,
|
|
225
236
|
})
|
|
226
237
|
)
|
|
227
238
|
},
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
|
+
export default function (request) {
|
|
4
|
+
const { appSecret } = request.config
|
|
5
|
+
return createMachine(
|
|
6
|
+
{
|
|
7
|
+
id: 'vip_table',
|
|
8
|
+
initial: 'fetching',
|
|
9
|
+
context: {
|
|
10
|
+
vipTable: [],
|
|
11
|
+
},
|
|
12
|
+
states: {
|
|
13
|
+
fetching: {
|
|
14
|
+
invoke: {
|
|
15
|
+
src: 'fetchVipTable',
|
|
16
|
+
onDone: {
|
|
17
|
+
target: 'completed',
|
|
18
|
+
actions: 'setVipTable',
|
|
19
|
+
},
|
|
20
|
+
onError: {
|
|
21
|
+
target: 'fail',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
completed: {},
|
|
26
|
+
fail: {},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
actions: {
|
|
31
|
+
setVipTable: assign((context, event) => {
|
|
32
|
+
const vipTable = event.data
|
|
33
|
+
|
|
34
|
+
return { vipTable }
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
services: {
|
|
38
|
+
fetchVipTable: async (context, event) => {
|
|
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) => {
|
|
48
|
+
item.title = item.title.toLowerCase()
|
|
49
|
+
return item
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return dataList
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|