@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.
- package/dist/index.amd.js +28 -0
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +28 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +28 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +28 -0
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +28 -0
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +28 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/src/Httpx.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1797,6 +1797,14 @@
|
|
|
1797
1797
|
fetch: details.fetch || this.context.#defaultDetails.fetch,
|
|
1798
1798
|
/* 对象使用深拷贝 */
|
|
1799
1799
|
fetchInit: utils.deepClone(this.context.#defaultDetails.fetchInit),
|
|
1800
|
+
allowInterceptConfig: {
|
|
1801
|
+
beforeRequest: this.context.#defaultDetails
|
|
1802
|
+
.allowInterceptConfig.beforeRequest,
|
|
1803
|
+
afterResponseSuccess: this.context.#defaultDetails
|
|
1804
|
+
.allowInterceptConfig.afterResponseSuccess,
|
|
1805
|
+
afterResponseError: this.context.#defaultDetails
|
|
1806
|
+
.allowInterceptConfig.afterResponseError,
|
|
1807
|
+
},
|
|
1800
1808
|
user: details.user || this.context.#defaultDetails.user,
|
|
1801
1809
|
password: details.password || this.context.#defaultDetails.password,
|
|
1802
1810
|
onabort(...args) {
|
|
@@ -1821,6 +1829,26 @@
|
|
|
1821
1829
|
that.context.HttpxCallBack.onLoad(details, resolve, reject, args);
|
|
1822
1830
|
},
|
|
1823
1831
|
};
|
|
1832
|
+
// 补全allowInterceptConfig参数
|
|
1833
|
+
if (typeof details.allowInterceptConfig === "boolean") {
|
|
1834
|
+
Object.keys(result.allowInterceptConfig).forEach((keyName) => {
|
|
1835
|
+
result.allowInterceptConfig[keyName] =
|
|
1836
|
+
details.allowInterceptConfig;
|
|
1837
|
+
});
|
|
1838
|
+
}
|
|
1839
|
+
else {
|
|
1840
|
+
if (typeof details.allowInterceptConfig === "object" &&
|
|
1841
|
+
details.allowInterceptConfig != null) {
|
|
1842
|
+
Object.keys(details.allowInterceptConfig).forEach((keyName) => {
|
|
1843
|
+
let value = details.allowInterceptConfig[keyName];
|
|
1844
|
+
if (keyName in
|
|
1845
|
+
result.allowInterceptConfig &&
|
|
1846
|
+
typeof value === "boolean") {
|
|
1847
|
+
result.allowInterceptConfig[keyName] = value;
|
|
1848
|
+
}
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1824
1852
|
if (typeof this.context.GM_Api.xmlHttpRequest !== "function") {
|
|
1825
1853
|
result.fetch = true;
|
|
1826
1854
|
}
|