#
luxiaotao1123
2024-02-28 f93a5719f77508aae2eb45eaa7e68bd447d607e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { Card, Form, message } from 'antd';
import React from 'react';
import {
  ProForm,
  ProFormText
} from '@ant-design/pro-components';
import { useModel } from '@umijs/max';
import Http from '@/utils/http';
 
const SecurityView = () => {
  const [form] = Form.useForm();
  const { initialState } = useModel('@@initialState');
  const { currentUser } = initialState || {};
 
  const handleFinish = (values) => {
    console.log(values);
  }
 
  return (
    <>
      <Card>
        <ProForm
          form={form}
          layout="vertical"
          onFinish={handleFinish}
          submitter={{
            searchConfig: {
              submitText: '修改密码',
            },
            render: (_, dom) => dom[1],
          }}
        >
          <ProFormText.Password
            width="md"
            name="currentPwd"
            label="当前密码"
            rules={[
              {
                required: true,
                message: '请输入当前密码!',
              },
            ]}
          />
          <ProFormText.Password
            width="md"
            name="newPwd"
            label="新密码"
            rules={[
              {
                required: true,
                message: '请输入新密码!',
              },
            ]}
          />
          <ProFormText.Password
            width="md"
            name="newPwdRepeat"
            label="确认密码"
            rules={[
              {
                required: true,
                message: '请再次输入新密码!',
              },
            ]}
          />
        </ProForm>
      </Card>
    </>
  );
};
 
export default SecurityView;