@mpxjs/api-proxy 2.9.19 → 2.9.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/api-proxy",
3
- "version": "2.9.19",
3
+ "version": "2.9.21",
4
4
  "description": "convert miniprogram API at each end",
5
5
  "module": "src/index.js",
6
6
  "types": "@types/index.d.ts",
@@ -39,5 +39,5 @@
39
39
  "dependencies": {
40
40
  "axios": "^1.6.7"
41
41
  },
42
- "gitHead": "3dbb31fbe48d689bbe0d0f2aaf7fbf80943b73d9"
42
+ "gitHead": "0ed5fa50016bd13a170c38619cfa9cbcc352ba23"
43
43
  }
@@ -68,21 +68,17 @@ function promisify (listObj, whiteList, customBlackList) {
68
68
  }
69
69
 
70
70
  result[key] = function (...args) {
71
- if (promisifyFilter(key)) {
71
+ const obj = args[0]
72
+ if (promisifyFilter(key) && !(obj.success || obj.fail || obj.complete)) {
72
73
  if (!args[0]) {
73
74
  args.unshift({ success: noop, fail: noop })
74
75
  }
75
- const obj = args[0]
76
76
  let returned
77
77
  const promise = new Promise((resolve, reject) => {
78
- const originSuccess = obj.success
79
- const originFail = obj.fail
80
78
  obj.success = function (res) {
81
- originSuccess && originSuccess.call(this, res)
82
79
  resolve(res)
83
80
  }
84
81
  obj.fail = function (e) {
85
- originFail && originFail.call(this, e)
86
82
  reject(e)
87
83
  }
88
84
  returned = listObj[key].apply(envObj, args)
@@ -1,5 +1,5 @@
1
1
  import { webHandleSuccess, webHandleFail, isTabBarPage, throwSSRWarning, isBrowser } from '../../../common/js'
2
- import { EventChannel } from '../event-channel'
2
+ import { EventChannel } from './event-channel'
3
3
 
4
4
  let routeCount = 0
5
5
 
@@ -107,6 +107,3 @@ export * from './api/window'
107
107
 
108
108
  // getEnterOptionsSync
109
109
  export * from './api/lifecycle'
110
-
111
- // EventChannel
112
- export * from './api/event-channel'