| | |
| | | import { getRemoteMenu, getRoutersInfo, getUserInfo, setRemoteMenu, patchRouteWithRemoteMenus } from './services/route'; |
| | | import { getToken, setToken } from '@/utils/token-util' |
| | | import { TOKEN_HEADER_NAME, TOKEN_STORE_NAME } from '@/config/setting'; |
| | | import { API_BASE_URL } from '@/config/setting' |
| | | import { API_BASE_URL, API_TIMEOUT } from '@/config/setting' |
| | | import { message } from 'antd'; |
| | | |
| | | import logo from '../public/img/logo.png' |
| | |
| | | export const layout = ({ initialState, setInitialState }) => { |
| | | const [darkMode, setDarkMode] = React.useState(() => { |
| | | const storedValue = localStorage.getItem('darkMode'); |
| | | return storedValue !== null ? JSON.parse(storedValue) : true; |
| | | return storedValue !== null ? JSON.parse(storedValue) : false; |
| | | }); |
| | | |
| | | const [layoutMode, setLayoutMode] = React.useState(() => { |
| | |
| | | |
| | | return { |
| | | actionsRender: () => [ |
| | | // <Question key="doc" />, |
| | | <SelectLang key="SelectLang" />, |
| | | <FullScreen fullScreen={fullScreen} setFullScreen={setFullScreen} />, |
| | | <LayoutSwitch layoutMode={layoutMode} setLayoutMode={setLayoutMode} />, |
| | | <Brightness darkMode={darkMode} setDarkMode={setDarkMode} />, |
| | | // <Question key="doc" />, |
| | | // <SelectLang key="SelectLang" /> |
| | | ], |
| | | avatarProps: { |
| | | src: initialState?.currentUser?.avatar, |
| | |
| | | export const request = { |
| | | baseURL: API_BASE_URL, |
| | | ...errorConfig, |
| | | timeout: 60000, |
| | | timeout: API_TIMEOUT * 1000, |
| | | // 前置守卫 |
| | | requestInterceptors: [ |
| | | (url, options) => { |