@jetthai/cuora 1.1.353-dev-12 → 1.1.353-dev-14

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 CHANGED
@@ -2,6 +2,42 @@
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.353-dev-14](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.353-dev-14) (2025-04-23)
6
+
7
+ ### [1.1.353-dev-13](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-12...v1.1.353-dev-13) (2025-04-21)
8
+
9
+ ### [1.1.353-dev-12](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-11...v1.1.353-dev-12) (2025-04-20)
10
+
11
+ ### [1.1.353-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-10...v1.1.353-dev-11) (2025-04-16)
12
+
13
+ ### [1.1.353-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-9...v1.1.353-dev-10) (2025-04-16)
14
+
15
+ ### [1.1.353-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.353-dev-9) (2025-04-16)
16
+
17
+ ### [1.1.353-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-7...v1.1.353-dev-8) (2025-04-15)
18
+
19
+ ### [1.1.353-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.354...v1.1.353-dev-7) (2025-04-14)
20
+
21
+ ### [1.1.353-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-5...v1.1.353-dev-6) (2025-04-14)
22
+
23
+ ### [1.1.353-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-4...v1.1.353-dev-5) (2025-04-14)
24
+
25
+ ### [1.1.353-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-3...v1.1.353-dev-4) (2025-04-14)
26
+
27
+ ### [1.1.353-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-2...v1.1.353-dev-3) (2025-04-11)
28
+
29
+ ### [1.1.353-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-1...v1.1.353-dev-2) (2025-04-11)
30
+
31
+ ### [1.1.353-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.346-wallet-1...v1.1.353-dev-1) (2025-04-11)
32
+
33
+ ### [1.1.346-wallet-1](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.346-wallet-1) (2025-04-10)
34
+
35
+ ### [1.1.353-dev-13](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-12...v1.1.353-dev-13) (2025-04-21)
36
+
37
+ ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-6...v1.1.354) (2025-04-14)
38
+
39
+ ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-6...v1.1.354) (2025-04-14)
40
+
5
41
  ### [1.1.353-dev-12](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-11...v1.1.353-dev-12) (2025-04-20)
6
42
 
7
43
  ### [1.1.353-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-10...v1.1.353-dev-11) (2025-04-16)
@@ -48,6 +84,12 @@ All notable changes to this project will be documented in this file. See [standa
48
84
 
49
85
  ### [1.1.353-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.353-dev-1) (2025-04-11)
50
86
 
87
+ ### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
88
+
89
+ ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
90
+
91
+ ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
92
+
51
93
  ### [1.1.353](https://github.com/jetthai/cuora-module/compare/v1.1.352...v1.1.353) (2025-04-02)
52
94
 
53
95
  ### [1.1.352](https://github.com/jetthai/cuora-module/compare/v1.1.351...v1.1.352) (2025-04-02)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.353-dev-12",
3
+ "version": "1.1.353-dev-14",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -125,18 +125,12 @@ export default function (request) {
125
125
 
126
126
  let nextDepositLimit = '0'
127
127
  let nextTurnoverLimit = '0'
128
- let currentTurnover = '0'
129
- let currentDeposit = '0'
130
128
  const maxReachLevel = conditions?.[conditions?.length - 1]
131
129
  // 若已達到最高等級,所有數值皆以最高等級顯示
132
130
  if (maxReachLevel && nextCycleCardCurrentReachLevel?.title === maxReachLevel.title) {
133
- currentDeposit = maxReachLevel.depositLimit
134
- currentTurnover = maxReachLevel.turnoverLimit
135
131
  nextDepositLimit = maxReachLevel.depositLimit
136
132
  nextTurnoverLimit = maxReachLevel.turnoverLimit
137
133
  } else {
138
- currentDeposit = accumulateTotalDeposit
139
- currentTurnover = accumulateTotalValidTurnover
140
134
  nextDepositLimit = nextCycleCardNextReachLevel?.depositLimit
141
135
  nextTurnoverLimit = nextCycleCardNextReachLevel?.turnoverLimit
142
136
  }
@@ -153,8 +147,8 @@ export default function (request) {
153
147
  lastCycleCard,
154
148
  nextDepositLimit,
155
149
  nextTurnoverLimit,
156
- accumulateTotalDeposit: currentDeposit,
157
- accumulateTotalValidTurnover: currentTurnover,
150
+ accumulateTotalDeposit,
151
+ accumulateTotalValidTurnover,
158
152
  retainAmount,
159
153
  yesterdayRewardsAmount,
160
154
  calculateWalletMode,
@@ -293,7 +293,8 @@ export default function (request) {
293
293
  return { announcementList: { data } }
294
294
  }),
295
295
  setFeeds: assign((context, event) => {
296
- const { announcementList, broadcastList, mailBoxInfo, siteConfig } = event.data
296
+ const { announcementList, broadcastList, mailBoxInfo } = event.data
297
+ const { siteConfig } = context
297
298
  const promotions = announcementList?.announcements?.filter?.((item) => item.category === 3) || []
298
299
  const customerMessageEnable = siteConfig?.csChat?.some((item) => item.enable && item.name === 'customermessage')
299
300
  if (!customerMessageEnable) {
@@ -33,12 +33,10 @@ export default function () {
33
33
  return { ...setting }
34
34
  }),
35
35
  setSetting: assign((context, event) => {
36
- console.log('*[DEV_ONLY]預設SETTING')
37
36
  const { sound, music, locale } = event.data
38
37
  return { sound, music, locale }
39
38
  }),
40
39
  saveSetting: assign((context, event) => {
41
- console.log('*[DEV_ONLY]修改SETTING')
42
40
  const { sound, music, locale } = event.data
43
41
  localStorage.setItem('setting', JSON.stringify({ sound, music, locale }))
44
42
  return { sound, music, locale }
@@ -2,6 +2,54 @@ import pickBy from 'lodash/pickBy.js'
2
2
  import storage from '../util/storage.js'
3
3
 
4
4
  // const pickBy = require('lodash/pickBy')
5
+ const supportVersion2List = [
6
+ 'game/play',
7
+ 'game/gameReplay',
8
+ 'game/logout',
9
+ 'game/list/v3/root',
10
+ 'game/list/v3/category',
11
+ 'game/list/v3/addition',
12
+ 'game/list/v3/categoryByRange',
13
+ 'game/list/v3/additionByRange',
14
+ 'game/list/v3/myFavorite',
15
+ 'game/list/v3/addMyFavorite',
16
+ 'game/list/v3/removeMyFavorite',
17
+ 'login',
18
+ 'callback/:strategy',
19
+ 'guestLogin',
20
+ 'appLogin',
21
+ 'logout',
22
+ 'self',
23
+ 'register',
24
+ 'settings/password',
25
+ 'verify',
26
+ 'reset',
27
+ 'acknowledge',
28
+ 'friends',
29
+ 'friends/home',
30
+ 'friends/reward-list',
31
+ 'recovery',
32
+ 'recovery/abandon',
33
+ 'recovery/acknowledge',
34
+ 'checkDt',
35
+ 'updateDt',
36
+ 'checkAC',
37
+ 'checkAccount',
38
+ 'getAllAvatar',
39
+ 'updateUserAvatar',
40
+ // 'getConfig',
41
+ // 'getQuickLayout',
42
+ // 'getNavbarSetting',
43
+ // 'getAffiliateCode',
44
+ // 'get-site-config',
45
+ 'friends/dashboard',
46
+ 'friends/dashboard/list',
47
+ 'mailbox/sendMessage',
48
+ 'mailbox/getMessageList',
49
+ 'mailbox/getMessage',
50
+ 'mailbox/updateMessage',
51
+ 'mailbox/getMessageTypes',
52
+ ]
5
53
 
6
54
  function isValid(value) {
7
55
  return value !== undefined && value !== null
@@ -24,7 +72,8 @@ export default class Request {
24
72
  axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
25
73
  axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform
26
74
  if (this.getToken()) {
27
- axiosConfig.headers.Authorization = this.getToken()
75
+ // 為了支援V2版本的API接口新增Bearer來進行身份驗證
76
+ axiosConfig.headers.Authorization = `Bearer ${this.getToken()}`
28
77
  }
29
78
  return axiosConfig
30
79
  })
@@ -85,9 +134,14 @@ export default class Request {
85
134
 
86
135
  _createConfig(req, cancelToken) {
87
136
  const { method, url, params, isPublic, isFormData, headers } = req
137
+ let fullURL = this.config.fullURL
138
+ if (supportVersion2List.includes(url)) {
139
+ console.log('*[DEV_ONLY]supportVersion2List:', url)
140
+ fullURL = fullURL.replace('/v1/', '/v2/')
141
+ }
88
142
  if (isFormData) {
89
143
  return {
90
- baseURL: this.config.fullURL,
144
+ baseURL: fullURL,
91
145
  method,
92
146
  url,
93
147
  cancelToken,
@@ -97,7 +151,7 @@ export default class Request {
97
151
  }
98
152
  } else {
99
153
  return {
100
- baseURL: this.config.fullURL,
154
+ baseURL: fullURL,
101
155
  method,
102
156
  url,
103
157
  cancelToken,