Skip to content

Commit

Permalink
feat(editor): 对登录页的一点小小优化
Browse files Browse the repository at this point in the history
- 感觉没必要放两个 "没有账号,去注册?",况且第一个按钮没法点击
  • Loading branch information
Topfunplus authored and jianbing.chen committed Dec 18, 2024
1 parent a937eaf commit 840fbc6
Show file tree
Hide file tree
Showing 2 changed files with 1,674 additions and 1,665 deletions.
11 changes: 9 additions & 2 deletions packages/editor/src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { useNavigate } from 'react-router-dom';
import { login, sendEmail, regist } from '@/api/user';
import storage from '@/utils/storage';
import { usePageStore } from '@/stores/pageStore';
import { SafetyOutlined, UserOutlined } from '@ant-design/icons';
import { LockOutlined, SafetyOutlined, UserOutlined } from '@ant-design/icons';
import style from './index.module.less';

type FieldType = {
userName: string;
code?: number;
Expand Down Expand Up @@ -119,14 +120,20 @@ export default function Login() {
</Form.Item>
)}

{type !== 'reset' && (
<Form.Item<FieldType> style={{ marginTop: 32 }} name="userPwd" rules={[{ required: true, message: '请输入密码' }]}>
<Input.Password prefix={<LockOutlined />} autoComplete="off" allowClear placeholder="请输入密码" />
</Form.Item>
)}

<Form.Item style={{ marginTop: 40 }}>
<Button type="primary" block htmlType="submit" loading={loading2} disabled={status}>
{type === 'login' ? '登录' : '注册'}
</Button>
</Form.Item>
<Form.Item style={{ marginTop: 40 }}>
<Flex justify="space-between" gap={20}>
<a onClick={() => onChange('login')}>{type === 'login' ? '没有账号?去注册' : '已有账号?去登录'}</a>
<a onClick={() => onChange('login')}>{type === 'login' ? '' : '已有账号?去登录'}</a>
<a onClick={() => onChange('regist')}>没有账号?去注册</a>
</Flex>
</Form.Item>
Expand Down
Loading

0 comments on commit 840fbc6

Please sign in to comment.