@whitesev/utils 1.9.0 → 1.9.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.
@@ -1796,6 +1796,14 @@ System.register('Utils', [], (function (exports) {
1796
1796
  fetch: details.fetch || this.context.#defaultDetails.fetch,
1797
1797
  /* 对象使用深拷贝 */
1798
1798
  fetchInit: utils.deepClone(this.context.#defaultDetails.fetchInit),
1799
+ allowInterceptConfig: {
1800
+ beforeRequest: this.context.#defaultDetails
1801
+ .allowInterceptConfig.beforeRequest,
1802
+ afterResponseSuccess: this.context.#defaultDetails
1803
+ .allowInterceptConfig.afterResponseSuccess,
1804
+ afterResponseError: this.context.#defaultDetails
1805
+ .allowInterceptConfig.afterResponseError,
1806
+ },
1799
1807
  user: details.user || this.context.#defaultDetails.user,
1800
1808
  password: details.password || this.context.#defaultDetails.password,
1801
1809
  onabort(...args) {
@@ -1820,6 +1828,26 @@ System.register('Utils', [], (function (exports) {
1820
1828
  that.context.HttpxCallBack.onLoad(details, resolve, reject, args);
1821
1829
  },
1822
1830
  };
1831
+ // 补全allowInterceptConfig参数
1832
+ if (typeof details.allowInterceptConfig === "boolean") {
1833
+ Object.keys(result.allowInterceptConfig).forEach((keyName) => {
1834
+ result.allowInterceptConfig[keyName] =
1835
+ details.allowInterceptConfig;
1836
+ });
1837
+ }
1838
+ else {
1839
+ if (typeof details.allowInterceptConfig === "object" &&
1840
+ details.allowInterceptConfig != null) {
1841
+ Object.keys(details.allowInterceptConfig).forEach((keyName) => {
1842
+ let value = details.allowInterceptConfig[keyName];
1843
+ if (keyName in
1844
+ result.allowInterceptConfig &&
1845
+ typeof value === "boolean") {
1846
+ result.allowInterceptConfig[keyName] = value;
1847
+ }
1848
+ });
1849
+ }
1850
+ }
1823
1851
  if (typeof this.context.GM_Api.xmlHttpRequest !== "function") {
1824
1852
  result.fetch = true;
1825
1853
  }