@base-web-kits/base-tools-web 1.0.2-alpha.2 → 1.0.2-alpha.4
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 +20 -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 +17 -0
- package/dist/network/request.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/web/config/index.ts +17 -1
- package/src/web/network/request.d.ts +6 -1
- package/src/web/network/request.ts +31 -7
|
@@ -1831,20 +1831,21 @@ var baseToolsWeb = (() => {
|
|
|
1831
1831
|
reject(res);
|
|
1832
1832
|
appConfig2.toLogin?.();
|
|
1833
1833
|
} else {
|
|
1834
|
-
if (toastError && msg) appConfig2.toast?.(msg);
|
|
1834
|
+
if (toastError && msg) appConfig2.toast?.({ status: "fail", msg });
|
|
1835
1835
|
reject(res);
|
|
1836
1836
|
}
|
|
1837
1837
|
} catch (e) {
|
|
1838
|
+
const status = "fail";
|
|
1838
1839
|
const isAbortError = e instanceof DOMException && e.name === "AbortError";
|
|
1839
1840
|
if (isAbortError && isTimeout) {
|
|
1840
|
-
if (toastError) appConfig2.toast?.("\u8BF7\u6C42\u8D85\u65F6");
|
|
1841
|
+
if (toastError) appConfig2.toast?.({ status, msg: "\u8BF7\u6C42\u8D85\u65F6" });
|
|
1841
1842
|
const timeoutError = new Error("Request Timeout");
|
|
1842
|
-
logRequestInfo({ status
|
|
1843
|
+
logRequestInfo({ status, config: logConfig, startTime, e: timeoutError });
|
|
1843
1844
|
reject(timeoutError);
|
|
1844
1845
|
return;
|
|
1845
1846
|
}
|
|
1846
|
-
if (!isAbortError && toastError) appConfig2.toast?.("\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25");
|
|
1847
|
-
logRequestInfo({ status
|
|
1847
|
+
if (!isAbortError && toastError) appConfig2.toast?.({ status, msg: "\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25" });
|
|
1848
|
+
logRequestInfo({ status, config: logConfig, startTime, e });
|
|
1848
1849
|
reject(e);
|
|
1849
1850
|
} finally {
|
|
1850
1851
|
if (timeoutId) clearTimeout(timeoutId);
|