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 = () => {

注册

{ > - - - + + + + - - + + { - - - 使用已有账户登录 - +
+ + + 使用已有账户登录 + +
diff --git a/src/pages/user/register/style.less b/src/pages/user/register/style.less deleted file mode 100644 index e13868f00c..0000000000 --- a/src/pages/user/register/style.less +++ /dev/null @@ -1,60 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.main { - width: 368px; - margin: 0 auto; - - h3 { - margin-bottom: 20px; - font-size: 16px; - } - - .password { - margin-bottom: 24px; - :global { - .ant-form-item-explain { - display: none; - } - } - } - - .getCaptcha { - display: block; - width: 100%; - } - - .submit { - width: 50%; - } - - .login { - float: right; - line-height: @btn-height-lg; - } -} - -.success, -.warning, -.error { - transition: color 0.3s; -} - -.success { - color: @success-color; -} - -.warning { - color: @warning-color; -} - -.error { - color: @error-color; -} - -.progress-pass > .progress { - :global { - .ant-progress-bg { - background-color: @warning-color; - } - } -} diff --git a/src/pages/user/register/style.style.ts b/src/pages/user/register/style.style.ts index fd52fe712f..cad6b68c91 100644 --- a/src/pages/user/register/style.style.ts +++ b/src/pages/user/register/style.style.ts @@ -15,13 +15,16 @@ const useStyles = createStyles(({ token }) => { display: 'block', width: '100%', }, + + footer: { + width: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + }, submit: { width: '50%', }, - login: { - float: 'right', - lineHeight: token.controlHeight, - }, success: { transition: 'color 0.3s', color: token.colorSuccess,