@jetthai/cuora 1.1.387-dev-5 → 1.1.387-qa-1
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 -18
- package/package.json +1 -1
- package/src/api/common.js +0 -6
- package/src/api/index.js +1 -2
- package/src/machine/common.js +8 -48
- package/src/machine/side_v2.js +2 -2
- package/src/request/request.js +0 -6
- package/src/api/account.js +0 -9
- package/src/util/sessionStorage.js +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -2,25 +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.387-
|
|
5
|
+
### [1.1.387-qa-1](https://github.com/jetthai/cuora-module/compare/v1.1.387-qa...v1.1.387-qa-1) (2025-09-26)
|
|
6
6
|
|
|
7
|
-
### [1.1.
|
|
8
|
-
|
|
9
|
-
### [1.1.388](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-3...v1.1.388) (2025-10-07)
|
|
10
|
-
|
|
11
|
-
### [1.1.387-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-3...v1.1.387-dev-4) (2025-10-09)
|
|
12
|
-
|
|
13
|
-
### [1.1.387-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-2...v1.1.387-dev-3) (2025-10-01)
|
|
14
|
-
|
|
15
|
-
### [1.1.387-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-1...v1.1.387-dev-2) (2025-10-01)
|
|
16
|
-
|
|
17
|
-
### [1.1.387-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev...v1.1.387-dev-1) (2025-09-26)
|
|
18
|
-
|
|
19
|
-
### [1.1.387-dev](https://github.com/jetthai/cuora-module/compare/v1.1.387...v1.1.387-dev) (2025-09-26)
|
|
20
|
-
|
|
21
|
-
### [1.1.389](https://github.com/jetthai/cuora-module/compare/v1.1.388...v1.1.389) (2025-10-07)
|
|
22
|
-
|
|
23
|
-
### [1.1.388](https://github.com/jetthai/cuora-module/compare/v1.1.387...v1.1.388) (2025-10-07)
|
|
7
|
+
### [1.1.387-qa](https://github.com/jetthai/cuora-module/compare/v1.1.387...v1.1.387-qa) (2025-09-26)
|
|
24
8
|
|
|
25
9
|
### [1.1.387](https://github.com/jetthai/cuora-module/compare/v1.1.386...v1.1.387) (2025-09-23)
|
|
26
10
|
|
package/package.json
CHANGED
package/src/api/common.js
CHANGED
|
@@ -7,10 +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
|
-
isPublic: true,
|
|
15
|
-
}),
|
|
16
10
|
}
|
package/src/api/index.js
CHANGED
|
@@ -7,6 +7,5 @@ import payment from './payment.js'
|
|
|
7
7
|
import user from './user.js'
|
|
8
8
|
import form from './form.js'
|
|
9
9
|
import ranking from './ranking.js'
|
|
10
|
-
import account from './account.js'
|
|
11
10
|
|
|
12
|
-
export default { activity, auth, common, game, mailbox, payment, user, form, ranking
|
|
11
|
+
export default { activity, auth, common, game, mailbox, payment, user, form, ranking }
|
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
|
|
@@ -42,7 +41,6 @@ export default function (request) {
|
|
|
42
41
|
defaultAffiliateCode: null,
|
|
43
42
|
friendCode: null,
|
|
44
43
|
isPlaying: false,
|
|
45
|
-
isLogin: false,
|
|
46
44
|
},
|
|
47
45
|
states: {
|
|
48
46
|
config: {
|
|
@@ -56,7 +54,7 @@ export default function (request) {
|
|
|
56
54
|
},
|
|
57
55
|
},
|
|
58
56
|
fetching: {
|
|
59
|
-
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'
|
|
57
|
+
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
|
|
60
58
|
invoke: {
|
|
61
59
|
src: 'fetchConfig',
|
|
62
60
|
onDone: [
|
|
@@ -90,20 +88,8 @@ export default function (request) {
|
|
|
90
88
|
},
|
|
91
89
|
},
|
|
92
90
|
feed: {
|
|
93
|
-
initial: '
|
|
91
|
+
initial: 'updating',
|
|
94
92
|
states: {
|
|
95
|
-
idle: {
|
|
96
|
-
on: {
|
|
97
|
-
LOGIN_REFRESH: {
|
|
98
|
-
target: 'updating',
|
|
99
|
-
actions: 'login',
|
|
100
|
-
},
|
|
101
|
-
LEAVE_GAME_REFRESH: {
|
|
102
|
-
target: 'updating',
|
|
103
|
-
actions: 'leaveGame',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
93
|
updating: {
|
|
108
94
|
invoke: {
|
|
109
95
|
src: 'fetchFeeds',
|
|
@@ -124,12 +110,11 @@ export default function (request) {
|
|
|
124
110
|
},
|
|
125
111
|
on: {
|
|
126
112
|
ENTER_GAME_PAUSE: {
|
|
127
|
-
target: '.idle',
|
|
128
113
|
actions: 'resetByEnterGame',
|
|
129
114
|
},
|
|
130
|
-
|
|
131
|
-
target: '.
|
|
132
|
-
actions: '
|
|
115
|
+
LEAVE_GAME_REFRESH: {
|
|
116
|
+
target: '.updating',
|
|
117
|
+
actions: 'leaveGame',
|
|
133
118
|
},
|
|
134
119
|
},
|
|
135
120
|
},
|
|
@@ -238,18 +223,6 @@ export default function (request) {
|
|
|
238
223
|
isMobile: userAgent?.device?.type,
|
|
239
224
|
}
|
|
240
225
|
}),
|
|
241
|
-
setFbclid: assign(() => {
|
|
242
|
-
const urlParams = new URLSearchParams(window.location.search)
|
|
243
|
-
const fbclid = urlParams.get('fbclid') || ''
|
|
244
|
-
if (fbclid !== '') {
|
|
245
|
-
const timestamp = Date.now()
|
|
246
|
-
const cookieRecord = 'fb.1.' + timestamp + '.' + fbclid
|
|
247
|
-
document.cookie = `_fbc=${cookieRecord}; path=/; max-age=${60 * 60 * 24 * 7}`
|
|
248
|
-
}
|
|
249
|
-
return {
|
|
250
|
-
fbclid,
|
|
251
|
-
}
|
|
252
|
-
}),
|
|
253
226
|
setPixel: assign(() => {
|
|
254
227
|
let urlParams = new URLSearchParams(window.location.search)
|
|
255
228
|
const pix = urlParams.get('pix') || storage.get('pix') || ''
|
|
@@ -285,7 +258,7 @@ export default function (request) {
|
|
|
285
258
|
const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
|
|
286
259
|
const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
|
|
287
260
|
const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
|
|
288
|
-
const friendCode = urlParams.get('fc') || urlParams.get('affiliate') ||
|
|
261
|
+
const friendCode = urlParams.get('fc') || urlParams.get('affiliate') || storage.get('fc') || storage.get('affiliate')
|
|
289
262
|
|
|
290
263
|
storage.set('channel', channel, {
|
|
291
264
|
path: '/',
|
|
@@ -299,7 +272,7 @@ export default function (request) {
|
|
|
299
272
|
path: '/',
|
|
300
273
|
maxAge: 60 * 60 * 24 * 7,
|
|
301
274
|
})
|
|
302
|
-
|
|
275
|
+
storage.set('fc', friendCode, {
|
|
303
276
|
path: '/',
|
|
304
277
|
maxAge: 60 * 60 * 24 * 7,
|
|
305
278
|
})
|
|
@@ -323,7 +296,7 @@ export default function (request) {
|
|
|
323
296
|
const { broadcastList, mailBoxInfo } = event.data
|
|
324
297
|
const { siteConfig } = context
|
|
325
298
|
const customerMessageEnable = siteConfig?.csChat?.some((item) => item.enable && item.name === 'customermessage')
|
|
326
|
-
if (!customerMessageEnable
|
|
299
|
+
if (!customerMessageEnable) {
|
|
327
300
|
mailBoxInfo.rows -= mailBoxInfo.detailRows?.CUSTOMER || 0
|
|
328
301
|
}
|
|
329
302
|
return { broadcastList, mailBoxInfo }
|
|
@@ -361,19 +334,6 @@ export default function (request) {
|
|
|
361
334
|
isPlaying: false,
|
|
362
335
|
}
|
|
363
336
|
}),
|
|
364
|
-
resetByLogout: assign((context, event) => {
|
|
365
|
-
return {
|
|
366
|
-
isLogin: false,
|
|
367
|
-
broadcastList: null,
|
|
368
|
-
mailBoxInfo: null,
|
|
369
|
-
promotions: null,
|
|
370
|
-
}
|
|
371
|
-
}),
|
|
372
|
-
login: assign((context, event) => {
|
|
373
|
-
return {
|
|
374
|
-
isLogin: true,
|
|
375
|
-
}
|
|
376
|
-
}),
|
|
377
337
|
},
|
|
378
338
|
guards: {
|
|
379
339
|
isAffiliateCodeInstructionsEnable: (context, event) => {
|
package/src/machine/side_v2.js
CHANGED
|
@@ -176,9 +176,9 @@ function isItemInMenu(targetItem, menuList) {
|
|
|
176
176
|
if (result) {
|
|
177
177
|
return true
|
|
178
178
|
} else {
|
|
179
|
-
if (currentItem
|
|
179
|
+
if (currentItem.categoryId === targetItem.categoryId) {
|
|
180
180
|
return true
|
|
181
|
-
} else if (currentItem
|
|
181
|
+
} else if (currentItem.sub?.length) {
|
|
182
182
|
return isItemInMenu(targetItem, currentItem.sub)
|
|
183
183
|
} else {
|
|
184
184
|
return false
|
package/src/request/request.js
CHANGED
|
@@ -140,12 +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
|
-
// 10/09
|
|
146
|
-
'account-binding/status',
|
|
147
|
-
'account-binding/bind',
|
|
148
|
-
'account-binding/acknowledge',
|
|
149
143
|
]
|
|
150
144
|
|
|
151
145
|
function isValid(value) {
|
package/src/api/account.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
// 取得綁定狀態
|
|
3
|
-
bindingStatus: () => ({ url: 'account-binding/status', method: 'get' }),
|
|
4
|
-
// 申請綁定(手機/信箱/帳號/Telegram) #TODO Telegram 綁定有需要傳遞的參數,後端說可以跟WELL確認
|
|
5
|
-
applyBinding: (data) => ({ url: 'account-binding/bind', method: 'post', params: data }),
|
|
6
|
-
bindingVerification: (data) => ({ url: 'account-binding/acknowledge', method: 'post', params: data }),
|
|
7
|
-
// #TODO 第三方綁定(參數要參考第三方註冊的參數,方法也待確)
|
|
8
|
-
// bindThirdParty: () => ({ url: 'account-binding/bind-third-party', method: ''}),
|
|
9
|
-
}
|
|
@@ -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
|
-
}
|