tx-sider 2.1.49 → 2.1.50

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
@@ -22451,9 +22451,12 @@ class Request {
22451
22451
  }
22452
22452
  },
22453
22453
  async (error) => {
22454
+ const router = useRouter();
22454
22455
  console.log("🚀 ~ Request ~ constructor ~ error:", error.response);
22455
22456
  if (error.response.status == 401) {
22456
22457
  const refresh_token = localStorage.getItem("refresh_token");
22458
+ localStorage.removeItem("token");
22459
+ localStorage.removeItem("refresh_token");
22457
22460
  console.log("🚀 ~ Request ~ refresh_token:", refresh_token);
22458
22461
  if (refresh_token) {
22459
22462
  const data3 = await refreshToken({
@@ -22468,10 +22471,9 @@ class Request {
22468
22471
  return;
22469
22472
  }
22470
22473
  }
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;
22474
+ localStorage.removeItem("token");
22475
+ localStorage.removeItem("refresh_token");
22476
+ router.push("/login");
22475
22477
  } else {
22476
22478
  let tips = "";
22477
22479
  if (error.response.status in httpCode) {