Yansen 2 years ago
parent
commit
60cf3075da
1 changed files with 4 additions and 5 deletions
  1. 4
    5
      src/layouts/AuthLayout/components/Header/User.jsx

+ 4
- 5
src/layouts/AuthLayout/components/Header/User.jsx View File

1
-import React, { useState, forwardRef, useRef } from 'react';
2
-import { Avatar, Dropdown, Menu, Form, Input, Modal } from 'antd';
1
+import React, { useState, forwardRef, useRef, useImperativeHandle } from 'react';
2
+import { Avatar, Button, Dropdown, Menu, Form, Input, Modal } from 'antd';
3
 
3
 
4
 const ChangePassword = forwardRef((props, ref) => {
4
 const ChangePassword = forwardRef((props, ref) => {
5
   const [visible, setVisible] = useState(false);
5
   const [visible, setVisible] = useState(false);
15
   });
15
   });
16
 
16
 
17
   return (
17
   return (
18
-    <Modal title="修改密码" visible={visible}>
18
+    <Modal title="修改密码" visible={visible} onCancel={() => setVisible(false)}>
19
       <Form
19
       <Form
20
         labelCol={{ span: 8 }}
20
         labelCol={{ span: 8 }}
21
         wrapperCol={{ span: 16 }}
21
         wrapperCol={{ span: 16 }}
22
         onFinish={onFinish}
22
         onFinish={onFinish}
23
-        onFinishFailed={onFinishFailed}
24
         autoComplete="off"
23
         autoComplete="off"
25
       >
24
       >
26
         <Form.Item
25
         <Form.Item
80
       <div className="user-info">
79
       <div className="user-info">
81
         <Avatar src="https://joeschmoe.io/api/v1/random" />
80
         <Avatar src="https://joeschmoe.io/api/v1/random" />
82
         <span className='font'>张延森</span>
81
         <span className='font'>张延森</span>
82
+        <ChangePassword ref={passRef} />
83
       </div>
83
       </div>
84
-      <ChangePassword ref={passRef} />
85
     </Dropdown>
84
     </Dropdown>
86
   )
85
   )
87
 }
86
 }