@jetthai/cuora 1.1.366-dev-12 → 1.1.366
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 +0 -54
- package/package.json +1 -1
- package/src/api/activity.js +3 -3
- package/src/api/common.js +1 -1
- package/src/api/game.js +0 -12
- package/src/api/payment.js +5 -5
- package/src/api/ranking.js +2 -2
- package/src/lib/{fingerprint_v3_11_12.js → fingerprint_v3_11_5.js} +4205 -3742
- package/src/machine/auth.js +4 -7
- package/src/machine/common.js +2 -3
- package/src/machine/honor_board_cash.js +1 -1
- package/src/machine/inbox.js +2 -13
- package/src/machine/index.js +0 -2
- package/src/machine/ranking.js +1 -2
- package/src/machine/reward.js +5 -15
- package/src/machine/reward_cash.js +3 -15
- package/src/machine/user_sign_up.js +2 -2
- package/src/machine/vip_table.js +4 -11
- package/src/request/request.js +7 -215
- package/src/util/deviceToken.js +2 -26
- package/src/util/index.js +2 -2
- package/src/util/storage.js +4 -18
- package/src/machine/game_betslip.js +0 -46
- package/src/util/sessionStorage.js +0 -28
package/src/util/storage.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
get(name, options) {
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
itemStr = localStorage.getItem(name)
|
|
6
|
-
} catch (error) {
|
|
7
|
-
console.error(`Error getting item from localStorage: ${error}`)
|
|
8
|
-
return null
|
|
9
|
-
}
|
|
3
|
+
const itemStr = localStorage.getItem(name)
|
|
10
4
|
|
|
11
5
|
if (!itemStr) {
|
|
12
6
|
return null
|
|
@@ -18,7 +12,7 @@ export default {
|
|
|
18
12
|
return null
|
|
19
13
|
}
|
|
20
14
|
|
|
21
|
-
return
|
|
15
|
+
return item.value
|
|
22
16
|
},
|
|
23
17
|
set(name, value, options) {
|
|
24
18
|
const item = { value }
|
|
@@ -26,17 +20,9 @@ export default {
|
|
|
26
20
|
if (options?.maxAge) {
|
|
27
21
|
item.expiry = new Date().getTime() + options.maxAge * 1000
|
|
28
22
|
}
|
|
29
|
-
|
|
30
|
-
localStorage.setItem(name, JSON.stringify(item))
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error(`Error setting item in localStorage: ${error}`)
|
|
33
|
-
}
|
|
23
|
+
localStorage.setItem(name, JSON.stringify(item))
|
|
34
24
|
},
|
|
35
25
|
remove(name, options) {
|
|
36
|
-
|
|
37
|
-
localStorage.removeItem(name)
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error(`Error removing item from localStorage: ${error}`)
|
|
40
|
-
}
|
|
26
|
+
localStorage.removeItem(name)
|
|
41
27
|
},
|
|
42
28
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import game from '../api/game.js'
|
|
3
|
-
|
|
4
|
-
export default function (request, context) {
|
|
5
|
-
const { appSecret } = request.config
|
|
6
|
-
const { providerId, seqNo, lang } = context
|
|
7
|
-
return createMachine(
|
|
8
|
-
{
|
|
9
|
-
id: 'game_betslip',
|
|
10
|
-
initial: 'fetching',
|
|
11
|
-
context: {
|
|
12
|
-
gameBetSlip: {},
|
|
13
|
-
},
|
|
14
|
-
states: {
|
|
15
|
-
fetching: {
|
|
16
|
-
invoke: {
|
|
17
|
-
src: 'fetchBetslip',
|
|
18
|
-
onDone: {
|
|
19
|
-
target: 'idle',
|
|
20
|
-
actions: 'setBetslip',
|
|
21
|
-
},
|
|
22
|
-
onError: {
|
|
23
|
-
target: 'idle',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
idle: {},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
actions: {
|
|
32
|
-
setBetslip: assign((context, event) => {
|
|
33
|
-
return {
|
|
34
|
-
gameBetSlip: event.data,
|
|
35
|
-
}
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
services: {
|
|
39
|
-
// 取得遊戲注單
|
|
40
|
-
fetchBetslip: async (context, event) => {
|
|
41
|
-
return await request.send(game.getBetslip({ providerId, seqNo, lang, appSecret }))
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
}
|
|
@@ -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
|
-
}
|