matrix_components 2.0.327 → 2.0.329

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.
@@ -76545,16 +76545,12 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
76545
76545
  } catch (error) {
76546
76546
  console.error("请求的ID生成失败:", error);
76547
76547
  }
76548
- const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.TonkenKey) || localStorage.getItem("TonkenKey") || localStorage.getItem("tonkenKey") || sessionStorage.getItem("TonkenKey") || sessionStorage.getItem("tonkenKey") || globalThis.TonkenKey || globalThis.tonkenKey || "satoken";
76549
- const tokenValue = ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.TonkenValue) || localStorage.getItem("TonkenValue") || localStorage.getItem("tonkenValue") || sessionStorage.getItem("TonkenValue") || sessionStorage.getItem("tonkenValue") || globalThis.TonkenValue || globalThis.tonkenValue || "";
76550
- setInterval(() => {
76551
- var _a4;
76552
- console.warn(`-----yyy---->`, sessionStorage, localStorage, (_a4 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a4.globalProperties);
76553
- }, 5e3);
76548
+ const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$TonkenKey) || localStorage.getItem("TonkenKey") || localStorage.getItem("tonkenKey") || sessionStorage.getItem("TonkenKey") || sessionStorage.getItem("tonkenKey") || globalThis.TonkenKey || globalThis.tonkenKey || "satoken";
76549
+ const tokenValue = ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$TonkenValue) || localStorage.getItem(tokenName) || sessionStorage.getItem(tokenName) || localStorage.getItem("TonkenValue") || sessionStorage.getItem("TonkenValue") || localStorage.getItem("tonkenValue") || sessionStorage.getItem("tonkenValue") || globalThis.TonkenValue || globalThis.tonkenValue || "";
76554
76550
  if (tokenValue) {
76555
76551
  config.headers[tokenName] = tokenValue;
76556
76552
  }
76557
- console.log(`token===>`, config.headers);
76553
+ console.log(`token===>`, tokenName, tokenValue);
76558
76554
  return config;
76559
76555
  },
76560
76556
  /**
@@ -76633,6 +76629,7 @@ async function errorFn(error) {
76633
76629
  return "网络连接错误";
76634
76630
  }
76635
76631
  async function errorStatus(status, message = "") {
76632
+ var _a3, _b;
76636
76633
  if (!message) {
76637
76634
  switch (status) {
76638
76635
  case 302:
@@ -76681,8 +76678,12 @@ async function errorStatus(status, message = "") {
76681
76678
  }
76682
76679
  if (message !== "ok") ElMessage.warning(message);
76683
76680
  if (status === 401) {
76684
- const logoutHandler = (app$1 == null ? void 0 : app$1.config.globalProperties.$LogoutCallback) || "";
76685
- logoutHandler == null ? void 0 : logoutHandler();
76681
+ try {
76682
+ const logoutHandler = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$LogoutCallback) || "";
76683
+ logoutHandler == null ? void 0 : logoutHandler();
76684
+ } catch (error) {
76685
+ console.warn("组件库未找到注销回调函数", error);
76686
+ }
76686
76687
  }
76687
76688
  return message;
76688
76689
  }
@@ -76693,7 +76694,7 @@ function setHttpApp(_app) {
76693
76694
  }
76694
76695
  function getBaseUrl() {
76695
76696
  var _a3, _b;
76696
- return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.BaseUrl) || localStorage.getItem("BaseUrl") || localStorage.getItem("bseUrl") || sessionStorage.getItem("BaseUrl") || sessionStorage.getItem("bseUrl") || globalThis.BaseUrl || globalThis.bseUrl || "";
76697
+ return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$BaseUrl) || localStorage.getItem("BaseUrl") || localStorage.getItem("bseUrl") || sessionStorage.getItem("BaseUrl") || sessionStorage.getItem("bseUrl") || globalThis.BaseUrl || globalThis.bseUrl || "";
76697
76698
  }
76698
76699
  const get = async (url, params, base = "", customConfig = {}, errorCallback = null) => {
76699
76700
  const baseUrl = base || getBaseUrl();