diff --git a/src/app.tsx b/src/app.tsx index 0edfa8028b..24f0610e99 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -34,7 +34,7 @@ export async function getInitialState(): Promise<{ }; // 如果不是登录页面,执行 const { location } = history; - if (location.pathname !== loginPath) { + if (![loginPath, '/user/register', '/user/register-result'].includes(location.pathname)) { const currentUser = await fetchUserInfo(); return { fetchUserInfo, diff --git a/src/pages/user/register-result/style.less b/src/pages/user/register-result/style.less deleted file mode 100644 index dc1b890501..0000000000 --- a/src/pages/user/register-result/style.less +++ /dev/null @@ -1,23 +0,0 @@ -.registerResult { - width: 800px; - min-height: 400px; - margin: auto; - padding: 80px; - background: none; - :global { - .anticon { - font-size: 64px; - } - } - .title { - margin-top: 32px; - font-size: 20px; - line-height: 28px; - } - .actions { - margin-top: 40px; - a + a { - margin-left: 8px; - } - } -} diff --git a/src/pages/user/register/index.tsx b/src/pages/user/register/index.tsx index 1c1c8e58de..f01966ee92 100644 --- a/src/pages/user/register/index.tsx +++ b/src/pages/user/register/index.tsx @@ -1,5 +1,5 @@ import { history, Link, useRequest } from '@umijs/max'; -import { Button, Col, Form, Input, message, Popover, Progress, Row, Select } from 'antd'; +import { Button, Col, Form, Input, message, Popover, Progress, Row, Select, Space } from 'antd'; import type { Store } from 'antd/es/form/interface'; import type { FC } from 'react'; import { useEffect, useState } from 'react'; @@ -9,7 +9,6 @@ import useStyles from './style.style'; const FormItem = Form.Item; const { Option } = Select; -const InputGroup = Input.Group; const passwordProgressMap: { ok: 'success'; @@ -83,7 +82,7 @@ const Register: FC = () => { if (data.status === 'ok') { message.success('注册成功!'); history.push({ - pathname: '/user/register-result?account=' + params.email, + pathname: `/user/register-result?account=${params[0].email}`, }); } }, @@ -140,7 +139,7 @@ const Register: FC = () => {