@jetthai/cuora 1.1.381 → 1.1.383

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,10 @@
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.383](https://github.com/jetthai/cuora-module/compare/v1.1.382...v1.1.383) (2025-09-16)
6
+
7
+ ### [1.1.382](https://github.com/jetthai/cuora-module/compare/v1.1.381...v1.1.382) (2025-09-16)
8
+
5
9
  ### [1.1.381](https://github.com/jetthai/cuora-module/compare/v1.1.380...v1.1.381) (2025-09-15)
6
10
 
7
11
  ### [1.1.380](https://github.com/jetthai/cuora-module/compare/v1.1.379...v1.1.380) (2025-09-11)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.381",
3
+ "version": "1.1.383",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -159,6 +159,30 @@ export default class Request {
159
159
  }
160
160
 
161
161
  initialize() {
162
+ // 自定義參數序列化器 - 避免使用 URLSearchParams
163
+ this.axios.defaults.paramsSerializer = function (params) {
164
+ return Object.keys(params)
165
+ .map((key) => {
166
+ let value = params[key]
167
+ if (value === null || value === undefined) {
168
+ return null
169
+ }
170
+ // 針對key為q的參數進行手動編碼,避免雙重編碼
171
+ if (key === 'q' && typeof value === 'string') {
172
+ // 處理其他需要編碼的字符
173
+ value = value.replace(/[!'()*]/g, function (c) {
174
+ return '%' + c.charCodeAt(0).toString(16).toUpperCase()
175
+ })
176
+ } else {
177
+ // 對其他參數使用標準編碼
178
+ value = encodeURIComponent(value)
179
+ }
180
+ return `${encodeURIComponent(key)}=${value}`
181
+ })
182
+ .filter(Boolean)
183
+ .join('&')
184
+ }
185
+
162
186
  this.axios.interceptors.request.use((axiosConfig) => {
163
187
  axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
164
188
  axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform