From d5c82c6aaff716a2ff3a4e0134a77d62a7be63c4 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 28 二月 2024 10:42:29 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/account/setting/components/security.jsx | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/zy-asrs-flow/src/pages/account/setting/components/security.jsx b/zy-asrs-flow/src/pages/account/setting/components/security.jsx
index c26f51c..83cc5fb 100644
--- a/zy-asrs-flow/src/pages/account/setting/components/security.jsx
+++ b/zy-asrs-flow/src/pages/account/setting/components/security.jsx
@@ -7,19 +7,20 @@
import { useModel } from '@umijs/max';
import Http from '@/utils/http';
-const resetPwd = async (val) => {
- const hide = message.loading('姝e湪鏇存柊');
+const resetPwd = async (val, form) => {
+ const hide = message.loading('姝e湪淇敼');
try {
- const resp = await Http.doPost('api/user/update', val);
+ const resp = await Http.doPost('api/user/reset/pwd', val);
if (resp.code === 200) {
- message.success('鏇存柊鎴愬姛');
+ message.success('淇敼鎴愬姛');
+ form.resetFields();
return true;
} else {
message.error(resp.msg);
return false;
}
} catch (error) {
- message.error('閰嶇疆澶辫触璇烽噸璇曪紒');
+ message.error('淇敼澶辫触璇烽噸璇曪紒');
return false;
} finally {
hide();
@@ -32,7 +33,7 @@
const { currentUser } = initialState || {};
const handleFinish = (values) => {
- resetPwd({...values, userId: currentUser.id});
+ resetPwd({...values, id: currentUser.id}, form);
}
return (
@@ -51,7 +52,7 @@
>
<ProFormText.Password
width="md"
- name="currentPwd"
+ name="oldPwd"
label="褰撳墠瀵嗙爜"
rules={[
{
@@ -62,7 +63,7 @@
/>
<ProFormText.Password
width="md"
- name="newPwd"
+ name="password"
label="鏂板瘑鐮�"
rules={[
{
@@ -81,7 +82,7 @@
/>
<ProFormText.Password
width="md"
- name="newPwdRepeat"
+ name="passwordRepeat"
label="纭瀵嗙爜"
rules={[
{
@@ -90,7 +91,7 @@
},
{
validator(_, value) {
- if (form.getFieldValue('newPwd') === value) return Promise.resolve();
+ if (form.getFieldValue('password') === value) return Promise.resolve();
return Promise.reject(new Error('涓ゆ杈撳叆鐨勫瘑鐮佷笉鐩哥!'));
}
}
--
Gitblit v1.9.1