feat: login page

This commit is contained in:
jialin
2024-06-03 09:06:41 +08:00
parent 69f354b278
commit d2212fe949
15 changed files with 147 additions and 23 deletions
+8
View File
@@ -8,6 +8,7 @@ import { ProLayout } from '@ant-design/pro-components';
import {
Link,
Outlet,
history,
matchRoutes,
useAppData,
useLocation,
@@ -21,6 +22,8 @@ import Logo from './Logo';
import { getRightRenderContent } from './rightRender';
import { patchRoutes } from './runtime';
const loginPath = '/login';
// 过滤出需要显示的路由, 这里的filterFn 指 不希望显示的层级
const filterRoutes = (
routes: IRoute[],
@@ -150,6 +153,11 @@ export default (props: any) => {
}}
onPageChange={(route) => {
console.log('onRouteChange', route);
const { location } = history;
// 如果没有登录,重定向到 login
// if (!initialState?.currentUser && location.pathname !== loginPath) {
// history.push(loginPath);
// }
}}
formatMessage={userConfig.formatMessage || formatMessage}
menu={{ locale: userConfig.locale }}