diff --git a/src/app.tsx b/src/app.tsx index 5c5c74c3..4345cb62 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -2,6 +2,7 @@ import { AvatarDropdown, AvatarName, Footer, Question, SelectLang } from '@/comp 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'; +import { App } from 'antd'; import { SettingDrawer } from '@ant-design/pro-components'; import type { RunTimeLayoutConfig } from '@umijs/max'; import { history, Link } from '@umijs/max'; @@ -136,3 +137,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = export const request = { ...errorConfig, }; + +export function rootContainer(container: React.ReactNode) { + return {container}; +} diff --git a/src/pages/User/Login/__snapshots__/login.test.tsx.snap b/src/pages/User/Login/__snapshots__/login.test.tsx.snap index 7b3fc0cf..a1e01db9 100644 --- a/src/pages/User/Login/__snapshots__/login.test.tsx.snap +++ b/src/pages/User/Login/__snapshots__/login.test.tsx.snap @@ -3,122 +3,77 @@ exports[`Login Page should login success 1`] = `
- - - -
-
-
+
+ -
-
-
- + +
+
+
-
+
+
+
+ + + +
+
+
- + +
-
-
- - - - -
- -
- - - - + - Serati Ma + + Serati Ma + - -
-
+
+ +
-
-
-
-
+
- - Welcome - + + Welcome + +
-
-
- 欢迎使用 Ant Design Pro -
-

- Ant Design Pro 是一个整合了 umi,Ant Design 和 ProComponents 的脚手架方案。致力于在设计规范和基础组件的基础上,继续向上构建,提炼出典型模板/业务组件/配套设计资源,进一步提升企业级中后台产品设计研发过程中的『用户』和『设计者』的体验。 -

-
+ 欢迎使用 Ant Design Pro +
+

+ Ant Design Pro 是一个整合了 umi,Ant Design 和 ProComponents 的脚手架方案。致力于在设计规范和基础组件的基础上,继续向上构建,提炼出典型模板/业务组件/配套设计资源,进一步提升企业级中后台产品设计研发过程中的『用户』和『设计者』的体验。 +

+
- 1 +
+ 1 +
+
+ 了解 umi +
- 了解 umi + umi 是一个可扩展的企业级前端应用框架,umi 以路由为基础的,同时支持配置式路由和约定式路由,保证路由的功能完备,并以此进行功能扩展。
+ + 了解更多 > +
- umi 是一个可扩展的企业级前端应用框架,umi 以路由为基础的,同时支持配置式路由和约定式路由,保证路由的功能完备,并以此进行功能扩展。 -
- - 了解更多 > - -
-
-
- 2 +
+ 2 +
+
+ 了解 ant design +
- 了解 ant design + antd 是基于 Ant Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。
+ + 了解更多 > +
- antd 是基于 Ant Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。 -
- - 了解更多 > - -
-
-
- 3 +
+ 3 +
+
+ 了解 Pro Components +
- 了解 Pro Components + ProComponents 是一个基于 Ant Design 做了更高抽象的模板组件,以 一个组件就是一个页面为开发理念,为中后台开发带来更好的体验。
+ + 了解更多 > +
-
- ProComponents 是一个基于 Ant Design 做了更高抽象的模板组件,以 一个组件就是一个页面为开发理念,为中后台开发带来更好的体验。 -
- - 了解更多 > -
+
-
-
-
-
- + +
@@ -575,490 +579,526 @@ exports[`Login Page should login success 1`] = ` exports[`Login Page should show login form 1`] = `
- - - - - -
-
+ + + +
- - - -
- - + +
`; diff --git a/src/pages/User/Login/index.tsx b/src/pages/User/Login/index.tsx index cb09e5cd..6d43b991 100644 --- a/src/pages/User/Login/index.tsx +++ b/src/pages/User/Login/index.tsx @@ -16,7 +16,7 @@ import { ProFormText, } from '@ant-design/pro-components'; import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max'; -import { Alert, message, Tabs } from 'antd'; +import { App, Alert, Tabs } from 'antd'; import { createStyles } from 'antd-style'; import React, { useState } from 'react'; import { flushSync } from 'react-dom'; @@ -100,6 +100,7 @@ const Login: React.FC = () => { const [type, setType] = useState('account'); const { initialState, setInitialState } = useModel('@@initialState'); const { styles } = useStyles(); + const { message } = App.useApp(); const intl = useIntl(); const fetchUserInfo = async () => {