react-toolkits 2.11.6 → 2.11.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-toolkits
2
2
 
3
+ ## 2.11.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 19cfebf: fix: useNavigate missing router
8
+
3
9
  ## 2.11.6
4
10
 
5
11
  ### Patch Changes
package/lib/index.js CHANGED
@@ -4,7 +4,7 @@ import { create, useStore, createStore } from 'zustand';
4
4
  import { persist, createJSONStorage } from 'zustand/middleware';
5
5
  import * as Antd2 from 'antd';
6
6
  import { Spin, Menu, Modal, Form, App, theme, Space, Input, Tag, Typography, Result, Table, Button, Empty, Dropdown, Divider, Card, Select, Alert, Switch, InputNumber, Row, Col, Breadcrumb, Skeleton, Descriptions, Tooltip, Popconfirm, Collapse, Checkbox } from 'antd';
7
- import { useLocation, Routes, Route, Navigate, useNavigate, Link, useParams } from 'react-router-dom';
7
+ import { useLocation, Routes, Route, Navigate, Link, useNavigate, useParams } from 'react-router-dom';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
  import { memo, useMemo, useCallback, useEffect, lazy, useContext, useState, useRef, Fragment as Fragment$1, Suspense, createContext, forwardRef, useImperativeHandle, cloneElement } from 'react';
10
10
  import useSWR5, { mutate, SWRConfig, unstable_serialize } from 'swr';
@@ -283,7 +283,6 @@ var init_axios = __esm({
283
283
  Interceptor = ({ children }) => {
284
284
  const state = useToolkitsStore((s) => s);
285
285
  const { notification } = App.useApp();
286
- const navaigate = useNavigate();
287
286
  if (!state.token) {
288
287
  return /* @__PURE__ */ jsx(Navigate, { to: state.signInPath });
289
288
  }
@@ -348,7 +347,7 @@ var init_axios = __esm({
348
347
  if (response.status === 412) {
349
348
  state.setUnregistered();
350
349
  }
351
- navaigate(state.signInPath);
350
+ window.location.replace(state.signInPath);
352
351
  } else if (response.status === 403) {
353
352
  notification.error({
354
353
  message: "Forbidden",