@base-web-kits/base-tools-web 1.4.3 → 1.4.5
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 -4
- package/dist/base-tools-web.umd.global.js.map +1 -1
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.mjs +3 -4
- package/dist/index.mjs.map +1 -1
- package/dist/network/uploadFile.d.ts +4 -5
- package/dist/network/uploadFile.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/web/network/uploadFile.ts +88 -112
|
@@ -2423,10 +2423,9 @@ var baseToolsWeb = (() => {
|
|
|
2423
2423
|
}
|
|
2424
2424
|
function upload(option, config) {
|
|
2425
2425
|
return new Promise((resolve, reject) => {
|
|
2426
|
-
var _a
|
|
2426
|
+
var _a;
|
|
2427
2427
|
const xhr = new XMLHttpRequest();
|
|
2428
|
-
const { url, file, name = "file", header, data, timeout = 0 } = option;
|
|
2429
|
-
const responseType = (_a = config == null ? void 0 : config.responseType) != null ? _a : "text";
|
|
2428
|
+
const { url, file, name = "file", header, data, timeout = 0, responseType = "text" } = option;
|
|
2430
2429
|
const fail = (error) => reject(error);
|
|
2431
2430
|
const success = (responseText) => {
|
|
2432
2431
|
if (responseType === "json") {
|
|
@@ -2447,7 +2446,7 @@ var baseToolsWeb = (() => {
|
|
|
2447
2446
|
},
|
|
2448
2447
|
abort: () => xhr.abort()
|
|
2449
2448
|
};
|
|
2450
|
-
(
|
|
2449
|
+
(_a = config == null ? void 0 : config.onTaskReady) == null ? void 0 : _a.call(config, task);
|
|
2451
2450
|
xhr.upload.onprogress = (e) => {
|
|
2452
2451
|
if (!e.lengthComputable) return;
|
|
2453
2452
|
const ev = {
|