@jetthai/cuora 1.1.368-qa-2 → 1.1.369

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,26 +2,14 @@
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.368-qa-2](https://github.com/jetthai/cuora-module/compare/v1.1.368-qa-1...v1.1.368-qa-2) (2025-08-06)
6
-
7
- ### [1.1.368-qa-1](https://github.com/jetthai/cuora-module/compare/v1.1.368...v1.1.368-qa-1) (2025-08-04)
5
+ ### [1.1.369](https://github.com/jetthai/cuora-module/compare/v1.1.368...v1.1.369) (2025-08-06)
8
6
 
9
7
  ### [1.1.368](https://github.com/jetthai/cuora-module/compare/v1.1.367...v1.1.368) (2025-07-28)
10
8
 
11
9
  ### [1.1.367](https://github.com/jetthai/cuora-module/compare/v1.1.366...v1.1.367) (2025-07-22)
12
10
 
13
- ### [1.1.366-v2api-2](https://github.com/jetthai/cuora-module/compare/v1.1.366-v2api-1...v1.1.366-v2api-2) (2025-07-18)
14
-
15
- ### [1.1.366-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.366...v1.1.366-v2api-1) (2025-07-18)
16
-
17
11
  ### [1.1.366](https://github.com/jetthai/cuora-module/compare/v1.1.365...v1.1.366) (2025-07-18)
18
12
 
19
- ### [1.1.365-v2api-3](https://github.com/jetthai/cuora-module/compare/v1.1.365-v2api-2...v1.1.365-v2api-3) (2025-07-18)
20
-
21
- ### [1.1.365-v2api-2](https://github.com/jetthai/cuora-module/compare/v1.1.365-v2api-1...v1.1.365-v2api-2) (2025-07-17)
22
-
23
- ### [1.1.365-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.365...v1.1.365-v2api-1) (2025-07-17)
24
-
25
13
  ### [1.1.365](https://github.com/jetthai/cuora-module/compare/v1.1.364...v1.1.365) (2025-07-08)
26
14
 
27
15
  ### [1.1.364](https://github.com/jetthai/cuora-module/compare/v1.1.363...v1.1.364) (2025-06-23)
@@ -30,28 +18,18 @@ All notable changes to this project will be documented in this file. See [standa
30
18
 
31
19
  ### [1.1.362](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.362) (2025-06-20)
32
20
 
33
- ### [1.1.361-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.361-v2api-1) (2025-06-05)
34
-
35
21
  ### [1.1.361](https://github.com/jetthai/cuora-module/compare/v1.1.360...v1.1.361) (2025-06-03)
36
22
 
37
23
  ### [1.1.360](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.360) (2025-06-03)
38
24
 
39
- ### [1.1.358-apiv2-2](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.358-apiv2-2) (2025-05-27)
40
-
41
25
  ### [1.1.359](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.359) (2025-05-23)
42
26
 
43
- ### [1.1.358-apiv2-1](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.358-apiv2-1) (2025-05-09)
44
-
45
27
  ### [1.1.358](https://github.com/jetthai/cuora-module/compare/v1.1.357...v1.1.358) (2025-05-09)
46
28
 
47
29
  ### [1.1.357](https://github.com/jetthai/cuora-module/compare/v1.1.356...v1.1.357) (2025-05-06)
48
30
 
49
31
  ### [1.1.356](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.356) (2025-04-29)
50
32
 
51
- ### [1.1.355-apiv2-2](https://github.com/jetthai/cuora-module/compare/v1.1.355-apiv2-1...v1.1.355-apiv2-2) (2025-05-07)
52
-
53
- ### [1.1.355-apiv2-1](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-apiv2-1) (2025-05-05)
54
-
55
33
  ### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
56
34
 
57
35
  ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.368-qa-2",
3
+ "version": "1.1.369",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -83,7 +83,7 @@ export default {
83
83
  settleAmount: (data) => ({ url: 'activities/exchange/diamond/settle', method: 'post', params: data }),
84
84
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
85
85
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
86
- getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
86
+ getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
87
87
  getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
88
88
  exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
89
89
  url: 'activities/exchange/diamond',
package/src/api/common.js CHANGED
@@ -2,7 +2,7 @@ export default {
2
2
  getConfig: ({ appSecret }) => ({ url: 'getConfig', method: 'get', params: { appSecret }, isPublic: true }),
3
3
  getLayoutConfig: ({ appSecret }) => ({ url: 'getQuickLayout', method: 'get', params: { appSecret }, isPublic: true }),
4
4
  feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
5
- broadcast: () => ({ url: 'broadcast', method: 'get', params: { appSecret }, isPublic: true }),
5
+ broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
6
6
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
7
7
  getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
8
8
  getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
3
- getSpotMarket: () => ({ url: 'payment/v2/spotmarket', method: 'get' }),
3
+ getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
4
4
  getTransactionHistory: (payload) => ({
5
5
  url: 'payment/v2/transactionHistory',
6
6
  method: 'post',
@@ -8,7 +8,7 @@ export default {
8
8
  }),
9
9
  getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
10
10
  getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
11
- getBindingPaymentInfo: () => ({ url: `payment/v2/getBindingPaymentInfo`, method: 'get' }),
11
+ getBindingPaymentInfo: () => ({ url: `payment/getBindingPaymentInfo`, method: 'get' }),
12
12
  updatePaymentInfo: ({
13
13
  bankCode,
14
14
  branch,
@@ -58,7 +58,7 @@ export default {
58
58
  }),
59
59
  getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
60
60
  getBindingBankList: ({ appSecret }) => ({ url: 'payment/v2/getBindingBankList', method: 'get', params: { appSecret }, isPublic: true }),
61
- getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/v2/getBindingPaymentList', method: 'get', params: { appSecret }, isPublic: true }),
61
+ getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/getBindingPaymentList', method: 'get', params: { appSecret }, isPublic: true }),
62
62
  getWithdrawBankList: () => ({ url: 'payment/v2/getWithdrawBankList', method: 'get' }),
63
63
  makeTransaction: ({ type, payload, paymentMethod }) => ({
64
64
  url: `payment/v2/${paymentMethod}/transaction`,
@@ -68,7 +68,7 @@ export default {
68
68
  ...payload,
69
69
  },
70
70
  }),
71
- checkTransaction: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/checkTransaction`, method: 'post' }),
71
+ checkTransaction: (paymentMethod) => ({ url: `payment/${paymentMethod}/checkTransaction`, method: 'post' }),
72
72
  setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
73
73
  getCurrentWithdrawRule: () => ({ url: 'payment/v2/getCurrentWithdrawRule', method: 'get' }),
74
74
  getDoubleWalletWithdrawRule: ({ walletType }) => ({
@@ -81,7 +81,7 @@ export default {
81
81
  method: 'post',
82
82
  params: { exchangeType, cryptoNetwork, targetAddress },
83
83
  }),
84
- mergeWallet: () => ({ url: 'payment/v2/mergeWallet', method: 'post' }),
84
+ mergeWallet: () => ({ url: 'payment/mergeWallet', method: 'post' }),
85
85
  getPaymentDetail: ({ transferType } = {}) => ({
86
86
  url: 'payment/v2/paymentDetail',
87
87
  method: 'post',
@@ -7,10 +7,10 @@ export default {
7
7
  isPublic: true,
8
8
  }),
9
9
  // 登入後排名預設期數資料
10
- getRankingOptions: ({ activityNo, appSecret }) => ({
10
+ getRankingOptions: ({ activityNo }) => ({
11
11
  url: 'ranking/detail/option',
12
12
  method: 'get',
13
- params: { activityNo, appSecret },
13
+ params: { activityNo },
14
14
  isPublic: true,
15
15
  }),
16
16
  // 登入後排名資料
@@ -233,7 +233,7 @@ export default function (request) {
233
233
  return await request.send(
234
234
  payment.getDepositExpectedResult({
235
235
  method: currentCrypto.method,
236
- amount: Number(currentAmount),
236
+ amount: currentAmount,
237
237
  cryptoCurrency: currentCrypto.channel,
238
238
  })
239
239
  )
@@ -280,7 +280,7 @@ export default function (request) {
280
280
  return await request.send(
281
281
  payment.getDepositExpectedResult({
282
282
  method: currentMethod,
283
- amount: Number(amount),
283
+ amount,
284
284
  promotionsNo: promotion?.activityNo,
285
285
  })
286
286
  )
@@ -195,7 +195,7 @@ export default function (request, context) {
195
195
  return await request.send(
196
196
  payment.getDepositExpectedResult({
197
197
  method: selectedDirect.method,
198
- amount: Number(selectedAmount),
198
+ amount: selectedAmount,
199
199
  promotionsNo: promotion?.promotionsNo,
200
200
  })
201
201
  )
@@ -355,7 +355,7 @@ export default function (request) {
355
355
  return await request.send(
356
356
  payment.getDepositExpectedResult({
357
357
  method,
358
- amount: Number(amount),
358
+ amount,
359
359
  promotionsNo: promotion?.activityNo,
360
360
  })
361
361
  )
@@ -183,7 +183,7 @@ export default function (request, context) {
183
183
  return await request.send(
184
184
  payment.getDepositExpectedResult({
185
185
  method: selectedLoadcard.method,
186
- amount: Number(selectedAmount),
186
+ amount: selectedAmount,
187
187
  promotionsNo: promotion?.promotionsNo,
188
188
  })
189
189
  )
@@ -319,7 +319,7 @@ export default function (request) {
319
319
  return await request.send(
320
320
  payment.getDepositExpectedResult({
321
321
  method: currentMethod,
322
- amount: Number(selectedAmount),
322
+ amount: selectedAmount,
323
323
  promotionsNo: promotion?.activityNo,
324
324
  })
325
325
  )
@@ -308,7 +308,7 @@ export default function (request, context) {
308
308
  return await request.send(
309
309
  payment.getDepositExpectedResult({
310
310
  method,
311
- amount: Number(selectedAmount),
311
+ amount: selectedAmount,
312
312
  promotionsNo: promotion?.promotionsNo,
313
313
  })
314
314
  )
@@ -402,7 +402,7 @@ export default function (request) {
402
402
  return await request.send(
403
403
  payment.getDepositExpectedResult({
404
404
  method,
405
- amount: Number(amount),
405
+ amount,
406
406
  promotionsNo: promotion?.activityNo,
407
407
  })
408
408
  )
@@ -196,7 +196,7 @@ export default function (request, context) {
196
196
  return await request.send(
197
197
  payment.getDepositExpectedResult({
198
198
  method: selectedQrcode.method,
199
- amount: Number(selectedAmount),
199
+ amount: selectedAmount,
200
200
  promotionsNo: promotion?.promotionsNo,
201
201
  })
202
202
  )
@@ -309,7 +309,7 @@ export default function (request) {
309
309
  return await request.send(
310
310
  payment.getDepositExpectedResult({
311
311
  method: currentMethod,
312
- amount: Number(selectedAmount),
312
+ amount: selectedAmount,
313
313
  promotionsNo: promotion?.activityNo,
314
314
  })
315
315
  )
@@ -179,7 +179,7 @@ export default function (request, context) {
179
179
  return await request.send(
180
180
  payment.getDepositExpectedResult({
181
181
  method,
182
- amount: Number(selectedAmount),
182
+ amount: selectedAmount,
183
183
  promotionsNo: promotion?.promotionsNo,
184
184
  })
185
185
  )
@@ -239,7 +239,7 @@ export default function (request) {
239
239
  return await request.send(
240
240
  payment.getDepositExpectedResult({
241
241
  method,
242
- amount: Number(amount),
242
+ amount,
243
243
  promotionsNo: promotion?.activityNo,
244
244
  })
245
245
  )
@@ -348,7 +348,7 @@ export default function (request) {
348
348
  return await request.send(
349
349
  payment.getDepositExpectedResult({
350
350
  method,
351
- amount: Number(amount),
351
+ amount,
352
352
  promotionsNo: promotion?.activityNo,
353
353
  })
354
354
  )
@@ -80,7 +80,7 @@ export default function (request) {
80
80
  },
81
81
  services: {
82
82
  fetchHonorBoardList: async (context, event) => {
83
- const { data } = await request.send(activity.getHonorBroadcast({ appSecret }))
83
+ const { data } = await request.send(activity.getHonorBroadcast(appSecret))
84
84
  return data
85
85
  },
86
86
  },
@@ -424,7 +424,7 @@ export default function (request) {
424
424
  fetchMessages: async (context, event) => {
425
425
  const lang = context.lang
426
426
  const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
427
- if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND')) {
427
+ if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND' || currentTab === 'FREE_GAME')) {
428
428
  const { data } = await request.send(activity.getRewardList({ count: 30, appSecret, lang }))
429
429
  inbox[currentTab] = { data, page: 0, totalPage: 1 }
430
430
  } else {
@@ -438,6 +438,9 @@ export default function (request) {
438
438
  },
439
439
  reFetchMessages: async (context, event) => {
440
440
  const { currentTab, inbox } = JSON.parse(JSON.stringify(context))
441
+
442
+ if (currentTab === 'FREE_GAME') return inbox
443
+
441
444
  const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: 0 }))
442
445
  let formattedData = []
443
446
  formattedData = data?.map((item) => ({ ...item, isSelected: false }))
@@ -2,7 +2,6 @@ import { createMachine, assign } from 'xstate'
2
2
  import ranking from '../api/ranking.js'
3
3
 
4
4
  export default function (request) {
5
- const { appSecret } = request.config
6
5
  const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
7
6
  const limit = { DAILY: 56, WEEKLY: 8, MONTHLY: 2, ALL: 2 }
8
7
 
@@ -200,7 +199,7 @@ export default function (request) {
200
199
  },
201
200
  fetchRankingOptions: async (context) => {
202
201
  const { activityNo } = context
203
- const { data } = await request.send(ranking.getRankingOptions({ activityNo, appSecret }))
202
+ const { data } = await request.send(ranking.getRankingOptions({ activityNo }))
204
203
  return data
205
204
  },
206
205
  fetchRankingDetail: async (context, event) => {
@@ -1,7 +1,6 @@
1
1
  import { assign, createMachine } from 'xstate'
2
2
  import activity from '../api/activity.js'
3
3
  export default function (request) {
4
- const { appSecret } = request.config
5
4
  return createMachine(
6
5
  {
7
6
  id: 'vip_table',
@@ -36,20 +35,14 @@ export default function (request) {
36
35
  },
37
36
  services: {
38
37
  fetchVipTable: async (context, event) => {
39
- const result = await request.send(activity.getVipTable({ appSecret }))
40
- let dataList = []
41
- // V2接口轉換中回傳的資料結構不同
42
- if (!result?.viptable) {
43
- dataList = result.data
44
- } else {
45
- dataList = result.viptable?.data
46
- }
47
- dataList.map((item) => {
38
+ const { viptable = {} } = await request.send(activity.getVipTable())
39
+ const { data = [] } = viptable
40
+ data.map((item) => {
48
41
  item.title = item.title.toLowerCase()
49
42
  return item
50
43
  })
51
44
 
52
- return dataList
45
+ return data
53
46
  },
54
47
  },
55
48
  }
@@ -2,139 +2,6 @@ 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
- // 04-09 Update
7
- 'game/play',
8
- 'game/gameReplay',
9
- 'game/logout',
10
- 'game/list/v3/root',
11
- 'game/list/v3/category',
12
- 'game/list/v3/addition',
13
- 'game/list/v3/categoryByRange',
14
- 'game/list/v3/additionByRange',
15
- 'game/list/v3/myFavorite',
16
- 'game/list/v3/addMyFavorite',
17
- 'game/list/v3/removeMyFavorite',
18
- 'login',
19
- 'callback/:strategy',
20
- 'guestLogin',
21
- 'appLogin',
22
- 'logout',
23
- 'self',
24
- 'register',
25
- 'settings/password',
26
- 'verify',
27
- 'reset',
28
- 'acknowledge',
29
- 'recovery',
30
- 'recovery/abandon',
31
- 'recovery/acknowledge',
32
- 'checkDt',
33
- 'updateDt',
34
- 'checkAC',
35
- 'checkAccount',
36
- 'getAllAvatar',
37
- 'updateUserAvatar',
38
- 'getConfig',
39
- 'getQuickLayout',
40
- 'getNavbarSetting',
41
- 'getAffiliateCode',
42
- 'get-site-config',
43
- 'mailbox/sendMessage',
44
- 'mailbox/getMessageList',
45
- 'mailbox/getMessage',
46
- 'mailbox/updateMessage',
47
- 'mailbox/getMessageTypes',
48
- // 05-23 Update
49
- 'game/info',
50
- 'recovery/v2/initiate',
51
- 'recovery/v2/acknowledge',
52
- 'recovery/v2/abandon',
53
- 'recovery/v2/reset',
54
- 'recovery/v2/changePassword',
55
- 'account-binding/status',
56
- 'account-binding/bind',
57
- 'account-binding/acknowledge',
58
- 'account-binding/bind-third-party',
59
- 'feeds',
60
- 'broadcast',
61
- 'upload',
62
- 'game/search',
63
- 'game/search/home',
64
- 'game/search/list',
65
- 'game/search/trace',
66
- 'game/history',
67
- 'game/history/detail',
68
- 'payment/v2/bankWallet/promotion/apply',
69
- 'payment/v2/bankWallet/promotion/giveUp',
70
- 'payment/v2/bankWallet/promotion/preview',
71
- 'payment/v2/bankWallet/promotions',
72
- 'payment/v2/bankWallet/restore',
73
- 'payment/v2/callback',
74
- 'payment/v2/convertFreeCredit',
75
- 'payment/v2/getBindingBankList',
76
- 'payment/v2/getBindingPaymentList',
77
- 'payment/v2/getWithdrawBankList',
78
- 'payment/v2/getCurrentWithdrawRule',
79
- 'payment/v2/withdrawCheck',
80
- 'payment/v2/history',
81
- 'payment/v2/mergeWallet',
82
- 'payment/v2/paymentDetail',
83
- 'payment/v2/category/options',
84
- 'payment/v2/paymentInfo',
85
- 'payment/v2/getBindingPaymentInfo',
86
- 'payment/v2/pendingOrder',
87
- 'payment/v2/promotions',
88
- 'payment/v2/spotmarket',
89
- 'payment/v2/transactionHistory',
90
- 'payment/v2/updateUtr',
91
- 'payment/v2/setting',
92
- 'payment/v2/amb/setting',
93
- 'payment/v2/updatePaymentInfo',
94
- 'payment/v2/uploadSlip',
95
- 'payment/v2/withdrawRule',
96
- 'payment/v2/:paymentType/getBankList',
97
- 'payment/v2/:paymentType/transaction',
98
- 'payment/v2/:paymentType/checkTransaction',
99
- 'payment/v2/:paymentType/bonus/preview',
100
- 'payment/v2/:paymentType/expected/result',
101
- 'payment/v2/:paymentType/crypto/expected/result',
102
- // 05-28 Update
103
- 'all-activities/list',
104
- 'activities/list',
105
- 'activities/rewards',
106
- 'activities/rewardAmount',
107
- 'activities/sentAward',
108
- 'activities/exchange',
109
- 'activities/collect',
110
- 'activities',
111
- 'activities/types',
112
- 'activities/promo',
113
- 'activities/viptable',
114
- 'activities/numbers',
115
- 'activities/honorBroadcast',
116
- 'activities/exchange/diamond/max-amount',
117
- 'activities/exchange/diamond/settle',
118
- 'tournament/detail',
119
- 'ranking/detail',
120
- 'ranking/detail/option',
121
- 'hot-game/ranking',
122
- 'activities/getFreeGameReward',
123
- 'activities/getFreeGameRewardList',
124
- 'activities/rebate/estimate',
125
- 'activities/rebate/collect',
126
- 'activities/rebate/history',
127
- 'activities/lose-rebate/history',
128
- 'friends',
129
- 'friends/home',
130
- 'friends/reward-list',
131
- 'friends/dashboard',
132
- 'friends/dashboard/list',
133
- 'activities/ranking',
134
- 'activities/activity/ranking',
135
- 'activities/cashRain',
136
- 'activities/jackpot/list',
137
- ]
138
5
 
139
6
  function isValid(value) {
140
7
  return value !== undefined && value !== null
@@ -157,8 +24,7 @@ export default class Request {
157
24
  axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
158
25
  axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform
159
26
  if (this.getToken()) {
160
- // 為了支援V2版本的API接口新增Bearer來進行身份驗證
161
- axiosConfig.headers.Authorization = `Bearer ${this.getToken()}`
27
+ axiosConfig.headers.Authorization = this.getToken()
162
28
  }
163
29
  return axiosConfig
164
30
  })
@@ -219,38 +85,11 @@ export default class Request {
219
85
 
220
86
  _createConfig(req, cancelToken) {
221
87
  const { method, url, params, isPublic, isFormData, headers } = req
222
- let fullURL = this.config.fullURL
223
- let urlName = url
224
- // 有些API會將參數(/?)直接帶在URL上,所以要將參數排除
225
- const cleanUrl = url.split('?')[0]
226
-
227
- const isV2Supported = supportVersion2List.some((supportedUrl) => {
228
- // 如果包含動態參數(:parameter),則使用模式匹配
229
- if (supportedUrl.includes(':')) {
230
- const pattern = supportedUrl.replace(/:[^/]+/g, '[^/]+')
231
- const regex = new RegExp(`^${pattern}$`)
232
- return regex.test(cleanUrl)
233
- }
234
- return supportedUrl === cleanUrl
235
- })
236
-
237
- // 如果站點是ZAZA,則不支援V2版本的API
238
- // clientId 可參照各站環境設定檔案
239
- const supportV2Toggle = ['ZAZA'].includes(this.config?.clientId)
240
-
241
- if (isV2Supported && !supportV2Toggle) {
242
- fullURL = fullURL.replace('/v1/', '/v2/')
243
- urlName = this._convertUrlToKebabCase(url)
244
- // console.log(`*[DEV_ONLY]V2`, 'url:', urlName)
245
- } else {
246
- // console.log(`*[DEV_ONLY]V2-不支援:`, 'url:', urlName)
247
- }
248
-
249
88
  if (isFormData) {
250
89
  return {
251
- baseURL: fullURL,
90
+ baseURL: this.config.fullURL,
252
91
  method,
253
- url: urlName,
92
+ url,
254
93
  cancelToken,
255
94
  isPublic,
256
95
  headers: { 'Content-Type': 'multipart/form-data' },
@@ -258,9 +97,9 @@ export default class Request {
258
97
  }
259
98
  } else {
260
99
  return {
261
- baseURL: fullURL,
100
+ baseURL: this.config.fullURL,
262
101
  method,
263
- url: urlName,
102
+ url,
264
103
  cancelToken,
265
104
  isPublic,
266
105
  headers,
@@ -269,38 +108,6 @@ export default class Request {
269
108
  }
270
109
  }
271
110
 
272
- // 調整API路徑與名稱
273
- _convertUrlToKebabCase(url) {
274
- const specifyingPath = {
275
- 'all-activities/list': 'activities/all-activities-list',
276
- friends: 'activities/friends',
277
- 'friends/home': 'activities/friends/home',
278
- 'friends/reward-list': 'activities/friends/reward-list',
279
- 'friends/dashboard': 'activities/friends/dashboard',
280
- 'friends/dashboard/list': 'activities/friends/dashboard/list',
281
- 'activities/getFreeGameReward': 'activities/free-game/get-free-game-reward',
282
- 'activities/getFreeGameRewardList': 'activities/free-game/get-free-game-reward-list',
283
- 'activities/lose-rebate/history': 'activities/rebate/lose-rebate/history',
284
- 'activities/ranking': 'activities/ranking/promotion-ranking',
285
- 'activities/activity/ranking': 'activities/ranking/basic-ranking',
286
- 'activities/cashRain': 'activities/cash-rain/exchange',
287
- 'tournament/detail': 'activities/tournament/detail',
288
- 'ranking/detail': 'activities/tournament/ranking/detail',
289
- 'ranking/detail/option': 'activities/tournament/ranking/detail/option',
290
- 'hot-game/ranking': 'activities/tournament/ranking/hot-game',
291
- 'activities/rebate/estimate': 'activities/rebate/estimate',
292
- 'activities/exchange/diamond/max-amount': 'activities/diamond/exchange/max-amount',
293
- 'activities/exchange/diamond/settle': 'activities/diamond/exchange/settle',
294
- }
295
- if (specifyingPath[url]) {
296
- // 和原有路徑不同有另外改路徑
297
- return specifyingPath[url]
298
- } else {
299
- // 將API_URL的命名規則由駝峰調整為短橫線(-)
300
- return url.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()
301
- }
302
- }
303
-
304
111
  _checkToken(req) {
305
112
  if (!req.isPublic && !this.getToken()) {
306
113
  throw { code: 'ERR_A103', url: req.url }