@jetthai/cuora 1.1.353-dev-13 → 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 +36 -0
- package/package.json +1 -1
- package/src/request/request.js +57 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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
|
+
|
|
5
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)
|
|
6
36
|
|
|
7
37
|
### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353-dev-6...v1.1.354) (2025-04-14)
|
|
@@ -54,6 +84,12 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
54
84
|
|
|
55
85
|
### [1.1.353-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.353-dev-1) (2025-04-11)
|
|
56
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
|
+
|
|
57
93
|
### [1.1.353](https://github.com/jetthai/cuora-module/compare/v1.1.352...v1.1.353) (2025-04-02)
|
|
58
94
|
|
|
59
95
|
### [1.1.352](https://github.com/jetthai/cuora-module/compare/v1.1.351...v1.1.352) (2025-04-02)
|
package/package.json
CHANGED
package/src/request/request.js
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
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:
|
|
154
|
+
baseURL: fullURL,
|
|
101
155
|
method,
|
|
102
156
|
url,
|
|
103
157
|
cancelToken,
|