@jetthai/cuora 1.1.400-dev-13 → 1.1.405
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 +5 -21
- package/package.json +1 -1
- package/src/api/common.js +0 -5
- package/src/machine/auth.js +4 -1
- package/src/machine/common.js +1 -13
- package/src/request/request.js +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,31 +2,15 @@
|
|
|
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.
|
|
5
|
+
### [1.1.405](https://github.com/jetthai/cuora-module/compare/v1.1.404...v1.1.405) (2025-12-16)
|
|
6
6
|
|
|
7
|
-
### [1.1.
|
|
7
|
+
### [1.1.404](https://github.com/jetthai/cuora-module/compare/v1.1.403...v1.1.404) (2025-12-16)
|
|
8
8
|
|
|
9
|
-
### [1.1.
|
|
9
|
+
### [1.1.403](https://github.com/jetthai/cuora-module/compare/v1.1.402...v1.1.403) (2025-12-16)
|
|
10
10
|
|
|
11
|
-
### [1.1.
|
|
11
|
+
### [1.1.402](https://github.com/jetthai/cuora-module/compare/v1.1.401...v1.1.402) (2025-12-16)
|
|
12
12
|
|
|
13
|
-
### [1.1.
|
|
14
|
-
|
|
15
|
-
### [1.1.400-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-7...v1.1.400-dev-8) (2025-12-16)
|
|
16
|
-
|
|
17
|
-
### [1.1.400-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-6...v1.1.400-dev-7) (2025-12-16)
|
|
18
|
-
|
|
19
|
-
### [1.1.400-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-5...v1.1.400-dev-6) (2025-12-16)
|
|
20
|
-
|
|
21
|
-
### [1.1.400-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-4...v1.1.400-dev-5) (2025-12-16)
|
|
22
|
-
|
|
23
|
-
### [1.1.400-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-3...v1.1.400-dev-4) (2025-12-16)
|
|
24
|
-
|
|
25
|
-
### [1.1.400-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-2...v1.1.400-dev-3) (2025-12-16)
|
|
26
|
-
|
|
27
|
-
### [1.1.400-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.400-dev-1...v1.1.400-dev-2) (2025-12-16)
|
|
28
|
-
|
|
29
|
-
### [1.1.400-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.400...v1.1.400-dev-1) (2025-12-09)
|
|
13
|
+
### [1.1.401](https://github.com/jetthai/cuora-module/compare/v1.1.400...v1.1.401) (2025-12-15)
|
|
30
14
|
|
|
31
15
|
### [1.1.400](https://github.com/jetthai/cuora-module/compare/v1.1.399...v1.1.400) (2025-11-25)
|
|
32
16
|
|
package/package.json
CHANGED
package/src/api/common.js
CHANGED
|
@@ -7,9 +7,4 @@ export default {
|
|
|
7
7
|
getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
|
|
8
8
|
getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
|
|
9
9
|
getSiteInfoConfig: ({ appSecret, config }) => ({ url: 'get-site-config', method: 'get', params: { appSecret, config }, isPublic: true }),
|
|
10
|
-
sendPixel: ({ appSecret, eventId, fbc, fbp, event }) => ({
|
|
11
|
-
url: 'pixel',
|
|
12
|
-
method: 'post',
|
|
13
|
-
params: { appSecret, eventId, fbc, fbp, event },
|
|
14
|
-
}),
|
|
15
10
|
}
|
package/src/machine/auth.js
CHANGED
|
@@ -465,7 +465,10 @@ export default function (request) {
|
|
|
465
465
|
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
466
466
|
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
467
467
|
|
|
468
|
-
|
|
468
|
+
// OZE、ZAZA 先使用 v2 測試 ,等待確認沒問題後再統一用 v2
|
|
469
|
+
// 但 ZALO 仍維持 v1
|
|
470
|
+
const fullURL =
|
|
471
|
+
['OZE', 'ZAZA'].includes(clientId) && provider !== 'zalo' ? request.config.fullURL.replace('/v1/', '/v2/') : request.config.fullURL
|
|
469
472
|
|
|
470
473
|
const redirectURL = urljoin(
|
|
471
474
|
fullURL,
|
package/src/machine/common.js
CHANGED
|
@@ -55,7 +55,7 @@ export default function (request) {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
fetching: {
|
|
58
|
-
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'
|
|
58
|
+
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
|
|
59
59
|
invoke: {
|
|
60
60
|
src: 'fetchConfig',
|
|
61
61
|
onDone: [
|
|
@@ -237,18 +237,6 @@ export default function (request) {
|
|
|
237
237
|
isMobile: userAgent?.device?.type,
|
|
238
238
|
}
|
|
239
239
|
}),
|
|
240
|
-
setFbclid: assign(() => {
|
|
241
|
-
const urlParams = new URLSearchParams(window.location.search)
|
|
242
|
-
const fbclid = urlParams.get('fbclid') || ''
|
|
243
|
-
if (fbclid !== '') {
|
|
244
|
-
const timestamp = Date.now()
|
|
245
|
-
const cookieRecord = 'fb.1.' + timestamp + '.' + fbclid
|
|
246
|
-
document.cookie = `_fbc=${cookieRecord}; path=/; max-age=${60 * 60 * 24 * 7}`
|
|
247
|
-
}
|
|
248
|
-
return {
|
|
249
|
-
fbclid,
|
|
250
|
-
}
|
|
251
|
-
}),
|
|
252
240
|
setPixel: assign(() => {
|
|
253
241
|
let urlParams = new URLSearchParams(window.location.search)
|
|
254
242
|
const pix = urlParams.get('pix') || storage.get('pix') || ''
|
package/src/request/request.js
CHANGED
|
@@ -140,8 +140,6 @@ const supportVersion2List = [
|
|
|
140
140
|
'game/list/v3/gameInfo',
|
|
141
141
|
'payment/v2/uploadCommonSlip',
|
|
142
142
|
'game/history/options',
|
|
143
|
-
// 09/30
|
|
144
|
-
'pixel',
|
|
145
143
|
// 10/09
|
|
146
144
|
'account-binding/status',
|
|
147
145
|
'account-binding/bind',
|
|
@@ -243,10 +241,13 @@ export default class Request {
|
|
|
243
241
|
this._checkToken(req)
|
|
244
242
|
|
|
245
243
|
const requestConfig = this._createConfig(req, cancelToken)
|
|
244
|
+
// console.log('*請求資料Check', requestConfig)
|
|
246
245
|
const configUrls = ['getConfig', 'get-config']
|
|
247
246
|
if (this.isBlocked && !configUrls.includes(requestConfig.url)) {
|
|
248
247
|
// 狀態是維護中&請求非siteConfig,終止所有的請求,除了維護頁需要的資料(siteConfig)
|
|
248
|
+
// console.log('%c*禁止的請求目標', requestConfig)
|
|
249
249
|
} else {
|
|
250
|
+
// console.log('%c*允許的請求目標', requestConfig)
|
|
250
251
|
const { data } = await this.axios.request(requestConfig)
|
|
251
252
|
return data
|
|
252
253
|
}
|
|
@@ -279,9 +280,9 @@ export default class Request {
|
|
|
279
280
|
const { method, url, params, isPublic, isFormData, headers } = req
|
|
280
281
|
let fullURL = this.config.fullURL
|
|
281
282
|
let urlName = url
|
|
282
|
-
|
|
283
283
|
// 有些API會將參數(/?)直接帶在URL上,所以要將參數排除
|
|
284
284
|
const cleanUrl = url.split('?')[0]
|
|
285
|
+
|
|
285
286
|
const isV2Supported = supportVersion2List.some((supportedUrl) => {
|
|
286
287
|
// 如果包含動態參數(:parameter),則使用模式匹配
|
|
287
288
|
if (supportedUrl.includes(':')) {
|
|
@@ -291,9 +292,16 @@ export default class Request {
|
|
|
291
292
|
}
|
|
292
293
|
return supportedUrl === cleanUrl
|
|
293
294
|
})
|
|
294
|
-
|
|
295
|
-
|
|
295
|
+
|
|
296
|
+
// 目前全站都支援V2,若有需要限制為V1的站點可以填入,此段等轉換全部完成之後就可以移除了
|
|
297
|
+
const supportV2Toggle = [''].includes(this.config?.clientId)
|
|
298
|
+
|
|
299
|
+
if (isV2Supported && !supportV2Toggle) {
|
|
300
|
+
fullURL = fullURL.replace('/v1/', '/v2/')
|
|
296
301
|
urlName = this._convertUrlToKebabCase(url)
|
|
302
|
+
// console.log(`*[DEV_ONLY]V2`, 'url:', urlName)
|
|
303
|
+
} else {
|
|
304
|
+
// console.log(`*[DEV_ONLY]V2-不支援:`, 'url:', urlName)
|
|
297
305
|
}
|
|
298
306
|
|
|
299
307
|
if (isFormData) {
|