|
|
@@ -186,27 +186,6 @@ class BasicLayout extends React.PureComponent {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
- getBashRedirect = () => {
|
|
|
- // According to the url parameter to redirect
|
|
|
- // 这里是重定向的,重定向到 url 的 redirect 参数所示地址
|
|
|
- const urlParams = new URL(window.location.href);
|
|
|
-
|
|
|
- const redirect = urlParams.searchParams.get('redirect');
|
|
|
- // Remove the parameters in the url
|
|
|
- if (redirect) {
|
|
|
- urlParams.searchParams.delete('redirect');
|
|
|
- window.history.replaceState(null, 'redirect', urlParams.href);
|
|
|
- } else {
|
|
|
- const { routerData } = this.props;
|
|
|
- // get the first authorized route path in routerData
|
|
|
- const authorizedPath = Object.keys(routerData).find(
|
|
|
- item => check(routerData[item].authority, item) && item !== '/'
|
|
|
- );
|
|
|
- return authorizedPath;
|
|
|
- }
|
|
|
- return redirect;
|
|
|
- };
|
|
|
-
|
|
|
handleMenuCollapse = collapsed => {
|
|
|
const { dispatch } = this.props;
|
|
|
dispatch({
|