@jetthai/cuora 1.1.373-dev-14 → 1.1.373-qa-2
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 +2 -26
- package/package.json +1 -1
- package/src/api/activity.js +0 -1
- package/src/machine/bank_binding.js +0 -6
- package/src/machine/common.js +2 -3
- package/src/machine/deposit/crypto_bank.js +2 -10
- package/src/machine/deposit/crypto_bank_cash.js +2 -10
- package/src/machine/deposit/crypto_way.js +2 -10
- package/src/machine/deposit/crypto_way_cash.js +2 -10
- package/src/machine/deposit/deposit_fc.js +0 -1
- package/src/machine/deposit/direct.js +0 -1
- package/src/machine/deposit/direct_cash.js +0 -1
- package/src/machine/deposit/float.js +0 -1
- package/src/machine/deposit/loadcard_cash.js +0 -1
- package/src/machine/deposit/loadcard_vn.js +0 -1
- package/src/machine/deposit/manual_cash.js +0 -1
- package/src/machine/deposit/manual_vn.js +0 -1
- package/src/machine/deposit/qrcode_cash.js +0 -1
- package/src/machine/deposit/qrcode_v2.js +0 -1
- package/src/machine/deposit/virtual_bank_cash.js +0 -1
- package/src/machine/deposit/virtual_bank_vn.js +0 -1
- package/src/machine/deposit/vpay.js +0 -1
- package/src/machine/withdraw/withdraw_crypto_cash.js +2 -10
- package/src/machine/withdraw/withdraw_manual.js +2 -10
- package/src/request/request.js +2 -19
- package/src/util/sessionStorage.js +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -2,33 +2,9 @@
|
|
|
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.373-
|
|
5
|
+
### [1.1.373-qa-2](https://github.com/jetthai/cuora-module/compare/v1.1.373-qa-1...v1.1.373-qa-2) (2025-08-25)
|
|
6
6
|
|
|
7
|
-
### [1.1.373-
|
|
8
|
-
|
|
9
|
-
### [1.1.373-dev-12](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-11...v1.1.373-dev-12) (2025-08-27)
|
|
10
|
-
|
|
11
|
-
### [1.1.373-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-10...v1.1.373-dev-11) (2025-08-27)
|
|
12
|
-
|
|
13
|
-
### [1.1.373-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-9...v1.1.373-dev-10) (2025-08-26)
|
|
14
|
-
|
|
15
|
-
### [1.1.373-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-8...v1.1.373-dev-9) (2025-08-26)
|
|
16
|
-
|
|
17
|
-
### [1.1.373-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-7...v1.1.373-dev-8) (2025-08-25)
|
|
18
|
-
|
|
19
|
-
### [1.1.373-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-6...v1.1.373-dev-7) (2025-08-23)
|
|
20
|
-
|
|
21
|
-
### [1.1.373-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-5...v1.1.373-dev-6) (2025-08-22)
|
|
22
|
-
|
|
23
|
-
### [1.1.373-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-4...v1.1.373-dev-5) (2025-08-22)
|
|
24
|
-
|
|
25
|
-
### [1.1.373-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-3...v1.1.373-dev-4) (2025-08-22)
|
|
26
|
-
|
|
27
|
-
### [1.1.373-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-2...v1.1.373-dev-3) (2025-08-22)
|
|
28
|
-
|
|
29
|
-
### [1.1.373-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.373-dev-1...v1.1.373-dev-2) (2025-08-16)
|
|
30
|
-
|
|
31
|
-
### [1.1.373-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.373...v1.1.373-dev-1) (2025-08-15)
|
|
7
|
+
### [1.1.373-qa-1](https://github.com/jetthai/cuora-module/compare/v1.1.373...v1.1.373-qa-1) (2025-08-22)
|
|
32
8
|
|
|
33
9
|
### [1.1.373](https://github.com/jetthai/cuora-module/compare/v1.1.372...v1.1.373) (2025-08-13)
|
|
34
10
|
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -85,7 +85,6 @@ export default {
|
|
|
85
85
|
exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
|
|
86
86
|
collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
|
|
87
87
|
getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
|
|
88
|
-
getLevelBonusInfo: () => ({ url: 'activities/level-bonus/info', method: 'get' }),
|
|
89
88
|
getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
|
|
90
89
|
exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
|
|
91
90
|
url: 'activities/exchange/diamond',
|
|
@@ -10,7 +10,6 @@ export default function (request) {
|
|
|
10
10
|
initial: 'fetching',
|
|
11
11
|
context: {
|
|
12
12
|
hasAnyAccount: false,
|
|
13
|
-
hasAnyBankAccount: false,
|
|
14
13
|
paymentList: {
|
|
15
14
|
bankList: [],
|
|
16
15
|
cryptoList: [],
|
|
@@ -170,14 +169,9 @@ export default function (request) {
|
|
|
170
169
|
setBanks: assign((context, event) => {
|
|
171
170
|
const { paymentList = {}, paymentInfo = {} } = event.data
|
|
172
171
|
const { bankInfo = [] } = paymentInfo
|
|
173
|
-
const { currency } = context
|
|
174
|
-
const firstBank = bankInfo.find((b) => b.bindingType === 'BANK' || b.bindingType === 'EWALLET')
|
|
175
|
-
|
|
176
172
|
return {
|
|
177
173
|
hasAnyAccount: bankInfo.length > 0,
|
|
178
|
-
hasAnyBankAccount: bankInfo.some((b) => b.bindingType === 'BANK' || b.bindingType === 'EWALLET'),
|
|
179
174
|
holderName: bankInfo[0]?.holderName,
|
|
180
|
-
ifscCode: currency === 'PKR' ? firstBank?.ifscCode : '',
|
|
181
175
|
firstNameLocale: bankInfo[0]?.firstNameLocale || null,
|
|
182
176
|
lastNameLocale: bankInfo[0]?.lastNameLocale || null,
|
|
183
177
|
paymentList,
|
package/src/machine/common.js
CHANGED
|
@@ -3,7 +3,6 @@ import { assign, createMachine } from 'xstate'
|
|
|
3
3
|
import pickBy from 'lodash/pickBy.js'
|
|
4
4
|
import api from '../api/common.js'
|
|
5
5
|
import storage from '../util/storage.js'
|
|
6
|
-
import sessionStorage from '../util/sessionStorage.js'
|
|
7
6
|
|
|
8
7
|
export default function (request) {
|
|
9
8
|
const { appSecret, defaultChannel, defaultSubchannel } = request.config
|
|
@@ -259,7 +258,7 @@ export default function (request) {
|
|
|
259
258
|
const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
|
|
260
259
|
const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
|
|
261
260
|
const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
|
|
262
|
-
const friendCode = urlParams.get('fc') || urlParams.get('affiliate') ||
|
|
261
|
+
const friendCode = urlParams.get('fc') || urlParams.get('affiliate') || storage.get('fc') || storage.get('affiliate')
|
|
263
262
|
|
|
264
263
|
storage.set('channel', channel, {
|
|
265
264
|
path: '/',
|
|
@@ -273,7 +272,7 @@ export default function (request) {
|
|
|
273
272
|
path: '/',
|
|
274
273
|
maxAge: 60 * 60 * 24 * 7,
|
|
275
274
|
})
|
|
276
|
-
|
|
275
|
+
storage.set('fc', friendCode, {
|
|
277
276
|
path: '/',
|
|
278
277
|
maxAge: 60 * 60 * 24 * 7,
|
|
279
278
|
})
|
|
@@ -232,16 +232,8 @@ export default function (request) {
|
|
|
232
232
|
}
|
|
233
233
|
}),
|
|
234
234
|
setCalculation: assign((context, event) => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (data) {
|
|
238
|
-
return {
|
|
239
|
-
calculation: data,
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
return {
|
|
243
|
-
calculation: event.data,
|
|
244
|
-
}
|
|
235
|
+
return {
|
|
236
|
+
calculation: event.data,
|
|
245
237
|
}
|
|
246
238
|
}),
|
|
247
239
|
clearCalculation: assign((context, event) => {
|
|
@@ -202,16 +202,8 @@ export default function (request, context) {
|
|
|
202
202
|
return { selectedAmount: event.data }
|
|
203
203
|
}),
|
|
204
204
|
setCalculation: assign((context, event) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (data) {
|
|
208
|
-
return {
|
|
209
|
-
calculation: data,
|
|
210
|
-
}
|
|
211
|
-
} else {
|
|
212
|
-
return {
|
|
213
|
-
calculation: event.data,
|
|
214
|
-
}
|
|
205
|
+
return {
|
|
206
|
+
calculation: event.data,
|
|
215
207
|
}
|
|
216
208
|
}),
|
|
217
209
|
clearCalculation: assign((context, event) => {
|
|
@@ -164,16 +164,8 @@ export default function (request) {
|
|
|
164
164
|
}
|
|
165
165
|
}),
|
|
166
166
|
setCalculation: assign((context, event) => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (data) {
|
|
170
|
-
return {
|
|
171
|
-
calculation: data,
|
|
172
|
-
}
|
|
173
|
-
} else {
|
|
174
|
-
return {
|
|
175
|
-
calculation: event.data,
|
|
176
|
-
}
|
|
167
|
+
return {
|
|
168
|
+
calculation: event.data,
|
|
177
169
|
}
|
|
178
170
|
}),
|
|
179
171
|
clearCalculation: assign((context, event) => {
|
|
@@ -168,16 +168,8 @@ export default function (request, context) {
|
|
|
168
168
|
}
|
|
169
169
|
}),
|
|
170
170
|
setCalculation: assign((context, event) => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (data) {
|
|
174
|
-
return {
|
|
175
|
-
calculation: data,
|
|
176
|
-
}
|
|
177
|
-
} else {
|
|
178
|
-
return {
|
|
179
|
-
calculation: event.data,
|
|
180
|
-
}
|
|
171
|
+
return {
|
|
172
|
+
calculation: event.data,
|
|
181
173
|
}
|
|
182
174
|
}),
|
|
183
175
|
clearCalculation: assign((context, event) => {
|
|
@@ -204,16 +204,8 @@ export default function (request, context) {
|
|
|
204
204
|
}
|
|
205
205
|
}),
|
|
206
206
|
setCalculation: assign((context, event) => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if (data) {
|
|
210
|
-
return {
|
|
211
|
-
calculation: data,
|
|
212
|
-
}
|
|
213
|
-
} else {
|
|
214
|
-
return {
|
|
215
|
-
calculation: event.data,
|
|
216
|
-
}
|
|
207
|
+
return {
|
|
208
|
+
calculation: event.data,
|
|
217
209
|
}
|
|
218
210
|
}),
|
|
219
211
|
resetCharge: assign((context, event) => {
|
|
@@ -384,16 +384,8 @@ export default function (request) {
|
|
|
384
384
|
}
|
|
385
385
|
}),
|
|
386
386
|
setCalculation: assign((context, event) => {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if (data) {
|
|
390
|
-
return {
|
|
391
|
-
calculation: data,
|
|
392
|
-
}
|
|
393
|
-
} else {
|
|
394
|
-
return {
|
|
395
|
-
calculation: event.data,
|
|
396
|
-
}
|
|
387
|
+
return {
|
|
388
|
+
calculation: event.data,
|
|
397
389
|
}
|
|
398
390
|
}),
|
|
399
391
|
clearCalculation: assign((context, event) => {
|
package/src/request/request.js
CHANGED
|
@@ -111,7 +111,6 @@ const supportVersion2List = [
|
|
|
111
111
|
'activities/types',
|
|
112
112
|
'activities/promo',
|
|
113
113
|
'activities/viptable',
|
|
114
|
-
'activities/level-bonus/info',
|
|
115
114
|
'activities/numbers',
|
|
116
115
|
'activities/honorBroadcast',
|
|
117
116
|
'activities/exchange/diamond/max-amount',
|
|
@@ -150,7 +149,6 @@ export default class Request {
|
|
|
150
149
|
this.key = `cuora_${config.clientId}`
|
|
151
150
|
this.errorHandler = null
|
|
152
151
|
this.hosts = []
|
|
153
|
-
this.isBlocked = false
|
|
154
152
|
this.initialize()
|
|
155
153
|
}
|
|
156
154
|
|
|
@@ -197,25 +195,10 @@ export default class Request {
|
|
|
197
195
|
try {
|
|
198
196
|
const cancelToken = customToken || this.source.token
|
|
199
197
|
this._checkToken(req)
|
|
200
|
-
|
|
201
198
|
const requestConfig = this._createConfig(req, cancelToken)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (this.isBlocked && !configUrls.includes(requestConfig.url)) {
|
|
205
|
-
// 狀態是維護中&請求非siteConfig,終止所有的請求,除了維護頁需要的資料(siteConfig)
|
|
206
|
-
// console.log('%c*禁止的請求目標', requestConfig)
|
|
207
|
-
} else {
|
|
208
|
-
// console.log('%c*允許的請求目標', requestConfig)
|
|
209
|
-
const { data } = await this.axios.request(requestConfig)
|
|
210
|
-
return data
|
|
211
|
-
}
|
|
199
|
+
const { data } = await this.axios.request(requestConfig)
|
|
200
|
+
return data
|
|
212
201
|
} catch (error) {
|
|
213
|
-
if (error.code === 'ERR_F108') {
|
|
214
|
-
console.log('%c*維護中', 'color: #00ff33ff; font-weight: bold;')
|
|
215
|
-
this.isBlocked = true
|
|
216
|
-
this.errorHandler && this.errorHandler(error)
|
|
217
|
-
throw error
|
|
218
|
-
}
|
|
219
202
|
if (error.code !== 'ERR_800') {
|
|
220
203
|
if (error.code) {
|
|
221
204
|
this.errorHandler && this.errorHandler(error)
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
get(name, options) {
|
|
3
|
-
const itemStr = sessionStorage.getItem(name)
|
|
4
|
-
|
|
5
|
-
if (!itemStr) {
|
|
6
|
-
return null
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const item = JSON.parse(itemStr)
|
|
10
|
-
if (item.expiry && new Date().getTime() > item.expiry) {
|
|
11
|
-
sessionStorage.removeItem(name)
|
|
12
|
-
return null
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return item.value
|
|
16
|
-
},
|
|
17
|
-
set(name, value, options) {
|
|
18
|
-
const item = { value }
|
|
19
|
-
|
|
20
|
-
if (options?.maxAge) {
|
|
21
|
-
item.expiry = new Date().getTime() + options.maxAge * 1000
|
|
22
|
-
}
|
|
23
|
-
sessionStorage.setItem(name, JSON.stringify(item))
|
|
24
|
-
},
|
|
25
|
-
remove(name, options) {
|
|
26
|
-
sessionStorage.removeItem(name)
|
|
27
|
-
},
|
|
28
|
-
}
|