chore: version info modal

This commit is contained in:
jialin
2024-07-12 12:06:17 +08:00
parent c5327d3e56
commit 320db56fbe
38 changed files with 334 additions and 108 deletions
+14 -1
View File
@@ -1,10 +1,10 @@
// @ts-nocheck
import { userAtom } from '@/atoms/user';
import VersionInfo from '@/components/version-info';
import { logout } from '@/pages/login/apis';
import { useAccessMarkedRoutes } from '@@/plugin-access';
import { useModel } from '@@/plugin-model';
import { ProLayout } from '@ant-design/pro-components';
import {
Link,
@@ -17,6 +17,7 @@ import {
useNavigate,
type IRoute
} from '@umijs/max';
import { Modal } from 'antd';
import { useAtom } from 'jotai';
import { useMemo, useState } from 'react';
import Exception from './Exception';
@@ -102,6 +103,15 @@ export default (props: any) => {
return intl.formatMessage({ id: args.id });
};
const showVersion = () => {
Modal.info({
icon: null,
centered: false,
width: 500,
content: <VersionInfo intl={intl} />
});
};
const runtimeConfig = {
...initialInfo,
logout: async (userInfo) => {
@@ -109,6 +119,9 @@ export default (props: any) => {
await logout();
navigate(loginPath);
},
showVersion: () => {
return showVersion();
},
notFound: <span>404 not found</span>
};