@base-web-kits/base-tools-web 1.1.8 → 1.1.10
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/base-tools-web.umd.global.js +3 -2
- package/dist/base-tools-web.umd.global.js.map +1 -1
- package/dist/index.cjs +1018 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1016 -13
- package/dist/index.js.map +1 -1
- package/dist/network/request.d.ts +2 -2
- package/dist/network/request.d.ts.map +1 -1
- package/package.json +41 -33
- package/src/web/network/request.ts +8 -5
|
@@ -1836,11 +1836,12 @@ var baseToolsWeb = (() => {
|
|
|
1836
1836
|
const isObjectData = isPlainObject(data);
|
|
1837
1837
|
const isArrayData = !isObjectData && Array.isArray(data);
|
|
1838
1838
|
const fillData = isObjectData ? pickBy(data, (val) => val !== void 0) : data;
|
|
1839
|
-
const
|
|
1839
|
+
const emptyValue = [void 0, null, ""];
|
|
1840
|
+
const fillHeader = header ? pickBy(header, (val) => !emptyValue.includes(val)) : {};
|
|
1840
1841
|
const contentTypeKey = Object.keys(fillHeader).find(
|
|
1841
1842
|
(k) => k.toLowerCase() === "content-type"
|
|
1842
1843
|
);
|
|
1843
|
-
const contentType = contentTypeKey ? fillHeader[contentTypeKey].toLowerCase() : "";
|
|
1844
|
+
const contentType = contentTypeKey ? String(fillHeader[contentTypeKey]).toLowerCase() : "";
|
|
1844
1845
|
if (!isGet && fillData && (isObjectData || isArrayData) && !contentType) {
|
|
1845
1846
|
fillHeader["Content-Type"] = "application/json";
|
|
1846
1847
|
}
|