diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 3884377..72b9122 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -6,6 +6,8 @@ class Auth { makeAutoObservable(this, { rootStore: false }); this.root = root; } + + loginUser = 'LiaoYijun(IT)'; } export default Auth; \ No newline at end of file diff --git a/src/views/App.jsx b/src/views/App.jsx index f966473..6594f9e 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -1,14 +1,13 @@ -import { Outlet, Link, useNavigation, useLocation } from "react-router-dom"; +import { Outlet, Link, useHref, useLocation } from "react-router-dom"; import { useEffect } from 'react'; -import { Breadcrumb, Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col } from 'antd'; +import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col } from 'antd'; import { - UserOutlined, - VideoCameraOutlined, DownOutlined } from '@ant-design/icons'; import 'antd/dist/reset.css'; +import { useStore } from '../stores/StoreContext.js'; -const { Header, Content, Footer, Sider } = Layout; +const { Header, Content, Footer } = Layout; const items = [ { label: ( @@ -39,14 +38,21 @@ const items = [ }, ] export default function App() { + + const { authStore } = useStore(); + + const href = useHref(); + let location = useLocation(); useEffect(() => { // Check location console.info('location.pathname: ' + location.pathname) }, [location]); + const { token: { colorBgContainer }, } = theme.useToken(); + return (
- Reservation }, - { key: 2, label: Feedback }, - { key: 3, label: Invoice } + { key: '/reservation/newest', label: Reservation }, + { key: '/feedback/list', label: Feedback }, + { key: '/invoice/list', label: Invoice } ] } /> @@ -80,7 +86,7 @@ export default function App() { > e.preventDefault()}> - LiaoYijun + {authStore.loginUser}