@jetthai/cuora 1.1.380-dev-2 → 1.1.381

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,15 +2,7 @@
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.380-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.387...v1.1.380-dev-2) (2025-09-25)
6
-
7
- ### [1.1.380-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.380-dev...v1.1.380-dev-1) (2025-09-15)
8
-
9
- ### [1.1.380-dev](https://github.com/jetthai/cuora-module/compare/v1.1.380...v1.1.380-dev) (2025-09-12)
10
-
11
- ### [1.1.380-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.380-dev...v1.1.380-dev-1) (2025-09-15)
12
-
13
- ### [1.1.380-dev](https://github.com/jetthai/cuora-module/compare/v1.1.380...v1.1.380-dev) (2025-09-12)
5
+ ### [1.1.381](https://github.com/jetthai/cuora-module/compare/v1.1.380...v1.1.381) (2025-09-15)
14
6
 
15
7
  ### [1.1.380](https://github.com/jetthai/cuora-module/compare/v1.1.379...v1.1.380) (2025-09-11)
16
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.380-dev-2",
3
+ "version": "1.1.381",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -85,7 +85,6 @@ export default {
85
85
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
86
86
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
87
87
  getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
88
- getLevelBonusInfo: () => ({ url: 'activities/level-bonus/info', method: 'get' }),
89
88
  getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
90
89
  exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
91
90
  url: 'activities/exchange/diamond',
package/src/api/user.js CHANGED
@@ -44,7 +44,7 @@ export default {
44
44
  params: { requestId, target, appSecret },
45
45
  isPublic: true,
46
46
  }),
47
- passwordV2Change: ({ requestId, target, newPassword, appSecret }) => ({
47
+ passwordV2Change: ({ requestId, target, newPassword }) => ({
48
48
  url: 'recovery/v2/changePassword',
49
49
  method: 'post',
50
50
  params: { requestId, target, newPassword, appSecret },
@@ -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
@@ -259,7 +258,7 @@ export default function (request) {
259
258
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
260
259
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
261
260
  const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
262
- const friendCode = urlParams.get('fc') || urlParams.get('affiliate') || sessionStorage.get('fc') || sessionStorage.get('affiliate')
261
+ const friendCode = urlParams.get('fc') || urlParams.get('affiliate') || storage.get('fc') || storage.get('affiliate')
263
262
 
264
263
  storage.set('channel', channel, {
265
264
  path: '/',
@@ -273,7 +272,7 @@ export default function (request) {
273
272
  path: '/',
274
273
  maxAge: 60 * 60 * 24 * 7,
275
274
  })
276
- sessionStorage.set('fc', friendCode, {
275
+ storage.set('fc', friendCode, {
277
276
  path: '/',
278
277
  maxAge: 60 * 60 * 24 * 7,
279
278
  })
@@ -76,7 +76,6 @@ export default function (request) {
76
76
  }),
77
77
  setSignUpId: assign((context, event) => {
78
78
  const {
79
- email,
80
79
  username,
81
80
  nick_name,
82
81
  password,
@@ -94,7 +93,6 @@ export default function (request) {
94
93
  return {
95
94
  signUpData: {
96
95
  provider: 'local',
97
- email,
98
96
  username,
99
97
  nick_name,
100
98
  password,
@@ -113,7 +111,6 @@ export default function (request) {
113
111
  }),
114
112
  setSignUpPhone: assign((context, event) => {
115
113
  const {
116
- email,
117
114
  countryCode,
118
115
  phone,
119
116
  nick_name,
@@ -130,7 +127,6 @@ export default function (request) {
130
127
  return {
131
128
  signUpData: {
132
129
  provider: 'phone',
133
- email,
134
130
  countryCode,
135
131
  phone,
136
132
  nick_name,
@@ -111,7 +111,6 @@ const supportVersion2List = [
111
111
  'activities/types',
112
112
  'activities/promo',
113
113
  'activities/viptable',
114
- 'activities/level-bonus/info',
115
114
  'activities/numbers',
116
115
  'activities/honorBroadcast',
117
116
  'activities/exchange/diamond/max-amount',
@@ -160,30 +159,6 @@ export default class Request {
160
159
  }
161
160
 
162
161
  initialize() {
163
- // 自定義參數序列化器 - 避免使用 URLSearchParams
164
- this.axios.defaults.paramsSerializer = function (params) {
165
- return Object.keys(params)
166
- .map((key) => {
167
- let value = params[key]
168
- if (value === null || value === undefined) {
169
- return null
170
- }
171
- // 針對key為q的參數進行手動編碼,避免雙重編碼
172
- if (key === 'q' && typeof value === 'string') {
173
- // 處理其他需要編碼的字符
174
- value = encodeURIComponent(value).replace(/[!'()*]/g, function (c) {
175
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
176
- })
177
- } else {
178
- // 對其他參數使用標準編碼
179
- value = encodeURIComponent(value)
180
- }
181
- return `${encodeURIComponent(key)}=${value}`
182
- })
183
- .filter(Boolean)
184
- .join('&')
185
- }
186
-
187
162
  this.axios.interceptors.request.use((axiosConfig) => {
188
163
  axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
189
164
  axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform
@@ -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
- }