|
@@ -2,14 +2,11 @@ import React, { useEffect, useState } from 'react'
|
|
|
import Header from '@/components/Header'
|
|
|
import { Button, Form, Input, message } from 'antd'
|
|
|
import styles from './index.module.scss'
|
|
|
+import consts from '@/utils/consts'
|
|
|
+import { apiChangePassword } from './api'
|
|
|
|
|
|
-interface iPassword {
|
|
|
- password: string
|
|
|
- newPassword: string
|
|
|
- confirmPassword: string
|
|
|
-}
|
|
|
|
|
|
-export default function index() {
|
|
|
+export default function Index() {
|
|
|
const [ form ] = Form.useForm()
|
|
|
const [ loading, setLoading ] = useState<boolean>(false)
|
|
|
|
|
@@ -17,12 +14,10 @@ export default function index() {
|
|
|
const changePassword = async (values:any) => {
|
|
|
setLoading(true)
|
|
|
|
|
|
- console.log(values)
|
|
|
- // const { code = -1 } = await apiAccountEdit(values)
|
|
|
- // if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- // message.success("更新成功!")
|
|
|
- // initData()
|
|
|
- // }
|
|
|
+ const { code = -1 } = await apiChangePassword(values)
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ message.success("更新成功!")
|
|
|
+ }
|
|
|
|
|
|
setLoading(false)
|
|
|
}
|
|
@@ -32,7 +27,7 @@ export default function index() {
|
|
|
<Header title="账号安全"></Header>
|
|
|
<div className={styles.projectInfo}>
|
|
|
<Form form={form} className={styles.formContent} layout="vertical" size="small">
|
|
|
- <Form.Item name="password" label="旧密码" rules={[ { required: true, message: '请输入旧密码' } ]}>
|
|
|
+ <Form.Item name="password" label="原密码" rules={[ { required: true, message: '请输入原密码' } ]}>
|
|
|
<Input.Password></Input.Password>
|
|
|
</Form.Item>
|
|
|
<Form.Item name="newPassword" label="新密码" rules={[ { required: true, message: '请输入新密码' } ]}>
|