From 27ad4b75cf29448adc75a18b585a86b33531ddec Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 28 二月 2024 10:14:42 +0800
Subject: [PATCH] #
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java | 4 +++-
zy-asrs-flow/src/pages/account/setting/components/security.jsx | 18 +++++++++---------
2 files changed, 12 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..45ce4bc 100644
--- a/zy-asrs-flow/src/pages/account/setting/components/security.jsx
+++ b/zy-asrs-flow/src/pages/account/setting/components/security.jsx
@@ -8,18 +8,18 @@
import Http from '@/utils/http';
const resetPwd = async (val) => {
- const hide = message.loading('姝e湪鏇存柊');
+ 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('淇敼鎴愬姛');
return true;
} else {
message.error(resp.msg);
return false;
}
} catch (error) {
- message.error('閰嶇疆澶辫触璇烽噸璇曪紒');
+ message.error('淇敼澶辫触璇烽噸璇曪紒');
return false;
} finally {
hide();
@@ -32,7 +32,7 @@
const { currentUser } = initialState || {};
const handleFinish = (values) => {
- resetPwd({...values, userId: currentUser.id});
+ resetPwd({...values, id: currentUser.id});
}
return (
@@ -51,7 +51,7 @@
>
<ProFormText.Password
width="md"
- name="currentPwd"
+ name="oldPwd"
label="褰撳墠瀵嗙爜"
rules={[
{
@@ -62,7 +62,7 @@
/>
<ProFormText.Password
width="md"
- name="newPwd"
+ name="password"
label="鏂板瘑鐮�"
rules={[
{
@@ -81,7 +81,7 @@
/>
<ProFormText.Password
width="md"
- name="newPwdRepeat"
+ name="passwordRepeat"
label="纭瀵嗙爜"
rules={[
{
@@ -90,7 +90,7 @@
},
{
validator(_, value) {
- if (form.getFieldValue('newPwd') === value) return Promise.resolve();
+ if (form.getFieldValue('password') === value) return Promise.resolve();
return Promise.reject(new Error('涓ゆ杈撳叆鐨勫瘑鐮佷笉鐩哥!'));
}
}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java
index a0393b0..c5f2ec1 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java
@@ -190,7 +190,9 @@
public R resetPwd(@RequestBody ResetPwdParam param) {
User user = userService.getById(param.getId());
if (!Cools.isEmpty(param.getOldPwd())) {
-
+ if (!userService.encodePassword(param.getOldPwd()).equals(user.getPassword())) {
+ return R.error("褰撳墠瀵嗙爜閿欒");
+ }
}
if (!Cools.isEmpty(param.getPassword())) {
user.setPassword(userService.encodePassword(param.getPassword()));
--
Gitblit v1.9.1