fix: change router
parent
a0616d8fca
commit
6ea019a98f
|
|
@ -16,6 +16,8 @@ export default [
|
|||
],
|
||||
},
|
||||
{ name: '查询表格', icon: 'table', path: '/list', component: './TableList' },
|
||||
{ name: '日志', icon: 'clockCircle', path: '/logs', component: './Logs' },
|
||||
{ name: '关于我们', icon: 'thunderbolt', path: '/about', component: './About' },
|
||||
{ path: '/', redirect: '/welcome' },
|
||||
{ path: '*', layout: false, component: './404' },
|
||||
];
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^4.8.1",
|
||||
"@ant-design/pro-components": "^2.6.48",
|
||||
"@ant-design/pro-components": "^2.7.0",
|
||||
"@umijs/route-utils": "^2.2.2",
|
||||
"antd": "^5.13.2",
|
||||
"antd-style": "^3.6.1",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AvatarDropdown, AvatarName, PageFooter, Question } from '@/components';
|
||||
import { AvatarDropdown, AvatarName, PageFooter } from '@/components';
|
||||
import { currentUser as queryCurrentUser } from '@/services/ant-design-pro/api';
|
||||
import { LinkOutlined } from '@ant-design/icons';
|
||||
import type { Settings as LayoutSettings } from '@ant-design/pro-components';
|
||||
|
|
@ -49,7 +49,6 @@ export async function getInitialState(): Promise<{
|
|||
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|
||||
export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => {
|
||||
return {
|
||||
actionsRender: () => [<Question key="doc" />],
|
||||
avatarProps: {
|
||||
src: initialState?.currentUser?.avatar,
|
||||
title: <AvatarName />,
|
||||
|
|
|
|||
|
|
@ -1,18 +1,2 @@
|
|||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import '@umijs/max';
|
||||
export type SiderTheme = 'light' | 'dark';
|
||||
export const Question = () => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
height: 26,
|
||||
}}
|
||||
onClick={() => {
|
||||
window.open('https://pro.ant.design/docs/getting-started');
|
||||
}}
|
||||
>
|
||||
<QuestionCircleOutlined />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
import { Typography } from 'antd';
|
||||
import React from 'react';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
|
||||
const Todo: React.FC = () => {
|
||||
return (
|
||||
<div>
|
||||
<Title level={1}>施工中...</Title>
|
||||
<Text type={'secondary'}>{'// TODO'}</Text>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Todo;
|
||||
|
|
@ -6,6 +6,6 @@
|
|||
* 布局组件
|
||||
*/
|
||||
import PageFooter from './Footer';
|
||||
import { Question } from './RightContent';
|
||||
import { AvatarDropdown, AvatarName } from './RightContent/AvatarDropdown';
|
||||
export { AvatarDropdown, AvatarName, PageFooter, Question };
|
||||
import Todo from './Todo';
|
||||
export { AvatarDropdown, AvatarName, PageFooter, Todo };
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
import { Todo } from '@/components';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Card } from 'antd';
|
||||
|
||||
const Logs: React.FC = () => {
|
||||
return (
|
||||
<PageContainer>
|
||||
<Card>
|
||||
<Todo />
|
||||
</Card>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
export default Logs;
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
import Settings from '@/../config/defaultSettings';
|
||||
import oidcLogo from '@/assets/oidc-logo.svg';
|
||||
import { PageFooter } from '@/components';
|
||||
import { login } from '@/services/ant-design-pro/api';
|
||||
|
|
@ -8,7 +9,6 @@ import { Alert, Button, Tabs, message } from 'antd';
|
|||
import { createStyles } from 'antd-style';
|
||||
import React, { CSSProperties, useState } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
import Settings from '../../../../config/defaultSettings';
|
||||
|
||||
const iconStyles: CSSProperties = {
|
||||
transform: 'translateY(-12%)',
|
||||
|
|
@ -63,11 +63,6 @@ const LoginMessage: React.FC<{
|
|||
/>
|
||||
);
|
||||
};
|
||||
const generateLink = () => {
|
||||
const preLink =
|
||||
'https://auth.zjueva.net/connect/authorize?response_type=code&client_id=tea&redirect_uri=https://xms.zjueva.net/api/external_sign&scope=openid&state=';
|
||||
return preLink + randomString(30);
|
||||
};
|
||||
|
||||
const randomString = (length: number) => {
|
||||
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
|
@ -78,6 +73,13 @@ const randomString = (length: number) => {
|
|||
}
|
||||
return randomStr;
|
||||
};
|
||||
|
||||
const generateLink = () => {
|
||||
const preLink =
|
||||
'https://auth.zjueva.net/connect/authorize?response_type=code&client_id=ETA&redirect_uri=https://xms.zjueva.net/api/external_sign&scope=openid&state=';
|
||||
return preLink + randomString(30);
|
||||
};
|
||||
|
||||
const Login: React.FC = () => {
|
||||
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({});
|
||||
const [type, setType] = useState<string>('account');
|
||||
|
|
@ -87,7 +89,7 @@ const Login: React.FC = () => {
|
|||
const userInfo = await initialState?.fetchUserInfo?.();
|
||||
if (userInfo) {
|
||||
flushSync(() => {
|
||||
setInitialState((s) => ({
|
||||
setInitialState((s: any) => ({
|
||||
...s,
|
||||
currentUser: userInfo,
|
||||
}));
|
||||
|
|
@ -143,7 +145,7 @@ const Login: React.FC = () => {
|
|||
initialValues={{
|
||||
autoLogin: true,
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
onFinish={async (values: API.LoginParams) => {
|
||||
await handleSubmit(values as API.LoginParams);
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue