@cloudbase/app 2.21.1 → 2.21.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/dist/cjs/constants/common.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/libs/request.js +3 -3
- package/dist/esm/constants/common.js +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/libs/request.js +3 -3
- package/dist/miniprogram/index.js +1 -1
- package/package.json +4 -4
- package/src/constants/common.ts +1 -1
- package/src/index.ts +1 -1
- package/src/libs/request.ts +2 -2
package/src/index.ts
CHANGED
|
@@ -140,7 +140,7 @@ class Cloudbase implements ICloudbase {
|
|
|
140
140
|
setGatewayEndPointWithEnv(env)
|
|
141
141
|
|
|
142
142
|
const app = new Cloudbase(this.cloudbaseConfig)
|
|
143
|
-
initRequest({ env, region: config.region || '', timeout, oauthClient, _fromApp: app, i18n })
|
|
143
|
+
initRequest({ env, region: config.region || '', timeout, oauthClient, _fromApp: app, i18n, endPointMode: config.endPointMode })
|
|
144
144
|
app.requestClient = this.requestClient
|
|
145
145
|
;(this as any)?.fire?.('cloudbase_init', app)
|
|
146
146
|
this.try2InitAuth(config, app)
|
package/src/libs/request.ts
CHANGED
|
@@ -243,13 +243,13 @@ export class CloudbaseRequest implements ICloudbaseRequest {
|
|
|
243
243
|
...formatQuery,
|
|
244
244
|
})
|
|
245
245
|
|
|
246
|
-
const { baseUrl: BASE_URL, protocol: PROTOCOL } = getEndPointInfo(this.config.env, 'CLOUD_API')
|
|
246
|
+
const { baseUrl: BASE_URL, protocol: PROTOCOL } = getEndPointInfo(this.config.env, this.config.endPointMode || 'CLOUD_API')
|
|
247
247
|
// 生成请求 url
|
|
248
248
|
let newUrl
|
|
249
249
|
if (options.pathname) {
|
|
250
250
|
newUrl = formatUrl(
|
|
251
251
|
PROTOCOL,
|
|
252
|
-
`${getBaseEndPoint(this.config.env)?.replace(/^https?:/, '')}/${options.pathname}`,
|
|
252
|
+
`${getBaseEndPoint(this.config.env, this.config.endPointMode || 'CLOUD_API')?.replace(/^https?:/, '')}/${options.pathname}`,
|
|
253
253
|
formatQuery,
|
|
254
254
|
)
|
|
255
255
|
} else {
|