@aliyun-obv/api 0.0.24 → 0.0.25

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/api.d.ts CHANGED
@@ -7,6 +7,7 @@ interface BaseFetchDefault {
7
7
  }
8
8
  interface BaseFetchOptions {
9
9
  forbidAlert?: boolean;
10
+ headers?: HeadersInit;
10
11
  }
11
12
  type IFetchAPI = (input: string, init?: RequestInit, options?: BaseFetchOptions) => Promise<any>;
12
13
  declare class BaseFetch<R> {
package/dist/api.es.js CHANGED
@@ -60,8 +60,12 @@ class BaseFetch {
60
60
  }
61
61
  callFetch(_0, _1) {
62
62
  return __async$1(this, arguments, function* (api, init, options = {}) {
63
+ let headers = init == null ? void 0 : init.headers;
63
64
  if (this.fetchApi != null) {
64
- return this.fetchApi(api, init, options);
65
+ if (options.headers) {
66
+ headers = Object.assign({}, init == null ? void 0 : init.headers, options.headers);
67
+ }
68
+ return this.fetchApi(api, Object.assign({}, init, { headers }), options);
65
69
  }
66
70
  return fetch(api, init);
67
71
  });
package/package.json CHANGED
@@ -11,5 +11,5 @@
11
11
  "lodash": "^4.17.21"
12
12
  },
13
13
  "devDependencies": {},
14
- "version": "0.0.24"
14
+ "version": "0.0.25"
15
15
  }