tx-sider 2.1.46 → 2.1.48

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/lib/TXUI.mjs CHANGED
@@ -22450,10 +22450,42 @@ class Request {
22450
22450
  return Promise.reject(response);
22451
22451
  }
22452
22452
  },
22453
- (error) => {
22454
- console.log(error.response.data.error.message, "---------------------请求的error");
22455
- let tips = error.response.status in httpCode ? error.response.data.error.message : httpCode[error.response.status];
22456
- message.error(tips);
22453
+ async (error) => {
22454
+ console.log("🚀 ~ Request ~ constructor ~ error:", error.response);
22455
+ if (error.response.status == 401) {
22456
+ const refresh_token = localStorage.getItem("refresh_token");
22457
+ console.log("🚀 ~ Request ~ refresh_token:", refresh_token);
22458
+ if (refresh_token) {
22459
+ const data3 = await refreshToken({
22460
+ refreshToken: refresh_token,
22461
+ clientId: "admin-client-demo",
22462
+ clientSecret: "1q2w3e*"
22463
+ });
22464
+ if (data3.access_token) {
22465
+ localStorage.setItem("token", data3.access_token);
22466
+ localStorage.setItem("refresh_token", data3.refresh_token);
22467
+ location.reload();
22468
+ return;
22469
+ }
22470
+ }
22471
+ window.location.hostname.split(".");
22472
+ const protocol2 = window.location.protocol;
22473
+ const loginUrl = process.env.NODE_ENV == "development" ? "http://localhost:3000/login" : `${protocol2}//${window.location.hostname}/login`;
22474
+ location.href = loginUrl;
22475
+ } else {
22476
+ let tips = "";
22477
+ if (error.response.status in httpCode) {
22478
+ if (error.response.data.error) {
22479
+ console.log(error.response);
22480
+ tips = error.response.data.error.message;
22481
+ } else {
22482
+ tips = "暂无权限,请联系管理员分配";
22483
+ }
22484
+ } else {
22485
+ tips = httpCode[error.response.status];
22486
+ }
22487
+ message.error(tips);
22488
+ }
22457
22489
  return Promise.reject(error);
22458
22490
  }
22459
22491
  );
@@ -24465,7 +24497,6 @@ const _sfc_main$1 = {
24465
24497
  localStorage.setItem("userPermissionModuleList", JSON.stringify(items));
24466
24498
  };
24467
24499
  function toProjectPages(routerPush) {
24468
- debugger;
24469
24500
  console.log("routerPush", routerPush);
24470
24501
  ctx.emit("routerPush", routerPush);
24471
24502
  }
@@ -24489,7 +24520,7 @@ const _sfc_main$1 = {
24489
24520
  };
24490
24521
  }
24491
24522
  };
24492
- const _withScopeId$1 = (n2) => (pushScopeId("data-v-78225a1a"), n2 = n2(), popScopeId(), n2);
24523
+ const _withScopeId$1 = (n2) => (pushScopeId("data-v-0c61d548"), n2 = n2(), popScopeId(), n2);
24493
24524
  const _hoisted_1$1 = {
24494
24525
  key: 0,
24495
24526
  class: "w-[80px] flex flex-col justify-center focusTC bb-f5f5f5 br-f5f5f5",
@@ -24610,7 +24641,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
24610
24641
  }, 8, ["activeKey"])
24611
24642
  ]);
24612
24643
  }
24613
- const EconomicsSider = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-78225a1a"]]);
24644
+ const EconomicsSider = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-0c61d548"]]);
24614
24645
  window.location.hostname.split(".");
24615
24646
  function encryptionStr(data3) {
24616
24647
  if (data3 === null || data3 === void 0) {