Skip to content

Commit

Permalink
增加getExtConfig, getExtConfigSync
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcuijuan committed Sep 12, 2024
1 parent f5bf595 commit 8ba133e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/api-proxy/src/platform/api/ext/index.ali.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {changeOpts, ENV_OBJ, envError} from '../../../common/js'

const getExtConfig = function (options = {}) {
const cacheSuc = options.success
options.success = function (res) {
const sucRes = changeOpts(res, {
data: 'extConfig'
})
cacheSuc.call(this, sucRes)
}
if (ENV_OBJ.getExtConfig) {
ENV_OBJ.getExtConfig(options)
} else {
envError('getExtConfig')
}
}

const getExtConfigSync = ENV_OBJ.getExtConfigSync || envError('getExtConfigSync')

export {
getExtConfig,
getExtConfigSync
}
10 changes: 10 additions & 0 deletions packages/api-proxy/src/platform/api/ext/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ENV_OBJ, envError } from '../../../common/js'

const getExtConfig = ENV_OBJ.getExtConfig || envError('getExtConfig')

const getExtConfigSync = ENV_OBJ.getExtConfigSync || envError('getExtConfigSync')

export {
getExtConfig,
getExtConfigSync
}
3 changes: 3 additions & 0 deletions packages/api-proxy/src/platform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ export * from './api/lifecycle'

// getLocation, openLocation, chooseLocation
export * from './api/location'

// getExtConfig, getExtConfigSync
export * from './api/ext'

0 comments on commit 8ba133e

Please sign in to comment.