@jetthai/cuora 1.1.380-dev-1 → 1.1.380-dev-2

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,12 @@
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
+
5
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)
6
12
 
7
13
  ### [1.1.380-dev](https://github.com/jetthai/cuora-module/compare/v1.1.380...v1.1.380-dev) (2025-09-12)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.380-dev-1",
3
+ "version": "1.1.380-dev-2",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
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 }) => ({
47
+ passwordV2Change: ({ requestId, target, newPassword, appSecret }) => ({
48
48
  url: 'recovery/v2/changePassword',
49
49
  method: 'post',
50
50
  params: { requestId, target, newPassword, appSecret },
@@ -160,6 +160,30 @@ export default class Request {
160
160
  }
161
161
 
162
162
  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
+
163
187
  this.axios.interceptors.request.use((axiosConfig) => {
164
188
  axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
165
189
  axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform