@base-web-kits/base-tools-web 1.0.2-alpha.2 → 1.0.2-alpha.3
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 +6 -5
- package/dist/base-tools-web.umd.global.js.map +1 -1
- package/dist/config/index.d.ts +4 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/network/request.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/web/config/index.ts +1 -1
- package/src/web/network/request.ts +6 -5
package/dist/config/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/config/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/config/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa;IACb,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC9E,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc;IACd,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAE5B,cAAc;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,cAAc;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,cAAc;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;IAEZ,WAAW;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAIF;;GAEG;AACH,wBAAgB,YAAY,cAE3B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,QAEtD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1657,20 +1657,21 @@ function request(config) {
|
|
|
1657
1657
|
reject(res);
|
|
1658
1658
|
appConfig2.toLogin?.();
|
|
1659
1659
|
} else {
|
|
1660
|
-
if (toastError && msg) appConfig2.toast?.(msg);
|
|
1660
|
+
if (toastError && msg) appConfig2.toast?.({ status: "fail", msg });
|
|
1661
1661
|
reject(res);
|
|
1662
1662
|
}
|
|
1663
1663
|
} catch (e) {
|
|
1664
|
+
const status = "fail";
|
|
1664
1665
|
const isAbortError = e instanceof DOMException && e.name === "AbortError";
|
|
1665
1666
|
if (isAbortError && isTimeout) {
|
|
1666
|
-
if (toastError) appConfig2.toast?.("\u8BF7\u6C42\u8D85\u65F6");
|
|
1667
|
+
if (toastError) appConfig2.toast?.({ status, msg: "\u8BF7\u6C42\u8D85\u65F6" });
|
|
1667
1668
|
const timeoutError = new Error("Request Timeout");
|
|
1668
|
-
logRequestInfo({ status
|
|
1669
|
+
logRequestInfo({ status, config: logConfig, startTime, e: timeoutError });
|
|
1669
1670
|
reject(timeoutError);
|
|
1670
1671
|
return;
|
|
1671
1672
|
}
|
|
1672
|
-
if (!isAbortError && toastError) appConfig2.toast?.("\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25");
|
|
1673
|
-
logRequestInfo({ status
|
|
1673
|
+
if (!isAbortError && toastError) appConfig2.toast?.({ status, msg: "\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25" });
|
|
1674
|
+
logRequestInfo({ status, config: logConfig, startTime, e });
|
|
1674
1675
|
reject(e);
|
|
1675
1676
|
} finally {
|
|
1676
1677
|
if (timeoutId) clearTimeout(timeoutId);
|