|
@@ -4,8 +4,8 @@ import RightContent from '@/components/RightContent'
|
|
|
import { message } from 'antd'
|
|
import { message } from 'antd'
|
|
|
import logo from '../public/logo.svg'
|
|
import logo from '../public/logo.svg'
|
|
|
import BasicModal, { BasicDrawer } from '@/components/Modal'
|
|
import BasicModal, { BasicDrawer } from '@/components/Modal'
|
|
|
-import { AddressBook } from '@icon-park/react'
|
|
|
|
|
import ws, { onMessage } from '@/utils/ws'
|
|
import ws, { onMessage } from '@/utils/ws'
|
|
|
|
|
+import Book from './components/RightContent/Book'
|
|
|
|
|
|
|
|
const loginPath = '/user/login'
|
|
const loginPath = '/user/login'
|
|
|
|
|
|
|
@@ -65,11 +65,12 @@ export const layout = ({ initialState }) => {
|
|
|
waterMarkProps: {
|
|
waterMarkProps: {
|
|
|
content: initialState?.currentUser?.username
|
|
content: initialState?.currentUser?.username
|
|
|
},
|
|
},
|
|
|
- onPageChange: async () => {
|
|
|
|
|
- const { location } = history
|
|
|
|
|
|
|
+ onPageChange: async location => {
|
|
|
// 如果没有登录,重定向到 login
|
|
// 如果没有登录,重定向到 login
|
|
|
if (!initialState?.currentUser?.staffId && location.pathname !== loginPath) {
|
|
if (!initialState?.currentUser?.staffId && location.pathname !== loginPath) {
|
|
|
history.replcae('/user/login')
|
|
history.replcae('/user/login')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Book.tryChangeWorkStatus(initialState?.currentUser?.staffId, location.pathname)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// if (
|
|
// if (
|
|
@@ -89,12 +90,12 @@ export const layout = ({ initialState }) => {
|
|
|
<BasicModal />
|
|
<BasicModal />
|
|
|
</>
|
|
</>
|
|
|
),
|
|
),
|
|
|
- links: [
|
|
|
|
|
- <div className="ant-menu-title-content">
|
|
|
|
|
- <AddressBook theme="outline" className="anticon" />
|
|
|
|
|
- <span className="ant-pro-menu-item-title">通讯录</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ // links: [
|
|
|
|
|
+ // <div className="ant-menu-title-content">
|
|
|
|
|
+ // <AddressBook theme="outline" className="anticon" />
|
|
|
|
|
+ // <span className="ant-pro-menu-item-title">通讯录</span>
|
|
|
|
|
+ // </div>
|
|
|
|
|
+ // ],
|
|
|
// menuHeaderRender: false,
|
|
// menuHeaderRender: false,
|
|
|
...initialState?.settings
|
|
...initialState?.settings
|
|
|
}
|
|
}
|