@jetthai/cuora 1.1.366-dev-11 → 1.1.366-dev-12

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,8 @@
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.366-dev-12](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-11...v1.1.366-dev-12) (2025-08-01)
6
+
5
7
  ### [1.1.366-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-10...v1.1.366-dev-11) (2025-08-01)
6
8
 
7
9
  ### [1.1.366-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.366-dev-9...v1.1.366-dev-10) (2025-08-01)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.366-dev-11",
3
+ "version": "1.1.366-dev-12",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -193,22 +193,21 @@ export default class Request {
193
193
  }
194
194
 
195
195
  async send(req, customToken) {
196
- // console.log('*查看請求的API', this.isBlocked, req)
197
- // 終止所有的請求,除了維護頁需要的資料(siteConfig)
198
- if (this.isBlocked && req.url !== 'getConfig') {
199
- console.log('%c*禁止API請求', 'color: #00ff33ff; font-weight: bold;')
200
- throw {
201
- code: 'ERR_BLOCKED',
202
- message: 'All API calls are blocked due to previous critical error',
203
- url: req.url,
204
- }
205
- }
206
196
  try {
207
197
  const cancelToken = customToken || this.source.token
208
198
  this._checkToken(req)
199
+
209
200
  const requestConfig = this._createConfig(req, cancelToken)
210
- const { data } = await this.axios.request(requestConfig)
211
- return data
201
+ // console.log('*請求資料Check', requestConfig)
202
+ const configUrls = ['getConfig', 'get-config']
203
+ if (this.isBlocked && !configUrls.includes(requestConfig.url)) {
204
+ // 狀態是維護中&請求非siteConfig,終止所有的請求,除了維護頁需要的資料(siteConfig)
205
+ // console.log('%c*禁止的請求目標', requestConfig)
206
+ } else {
207
+ // console.log('%c*允許的請求目標', requestConfig)
208
+ const { data } = await this.axios.request(requestConfig)
209
+ return data
210
+ }
212
211
  } catch (error) {
213
212
  if (error.code === 'ERR_F108') {
214
213
  console.log('%c*維護中', 'color: #00ff33ff; font-weight: bold;')