@base-web-kits/base-tools-web 1.0.2-alpha.1 → 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.
@@ -753,7 +753,7 @@ var baseToolsWeb = (() => {
753
753
  removeCookie: () => removeCookie,
754
754
  removeLocalStorage: () => removeLocalStorage,
755
755
  request: () => request,
756
- setAppConfig: () => setAppConfig,
756
+ setBaseToolsConfig: () => setBaseToolsConfig,
757
757
  setCookie: () => setCookie,
758
758
  setLocalStorage: () => setLocalStorage,
759
759
  unlockBodyScroll: () => unlockBodyScroll,
@@ -964,7 +964,7 @@ var baseToolsWeb = (() => {
964
964
  function getAppConfig() {
965
965
  return appConfig;
966
966
  }
967
- function setAppConfig(newConfig) {
967
+ function setBaseToolsConfig(newConfig) {
968
968
  Object.assign(appConfig, newConfig);
969
969
  }
970
970
 
@@ -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: "fail", config: logConfig, startTime, e: timeoutError });
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: "fail", config: logConfig, startTime, e });
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);