From 80a82efcb42ba4b6f24768e780b1b3f51e3141f4 Mon Sep 17 00:00:00 2001 From: vincentlu <t1341870251@gmail.com> Date: 星期一, 10 二月 2025 08:01:26 +0800 Subject: [PATCH] # --- rsf-admin/src/page/settings/SecuritySettings.jsx | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/rsf-admin/src/page/settings/SecuritySettings.jsx b/rsf-admin/src/page/settings/SecuritySettings.jsx index 9ef9bd9..1a68e18 100644 --- a/rsf-admin/src/page/settings/SecuritySettings.jsx +++ b/rsf-admin/src/page/settings/SecuritySettings.jsx @@ -14,7 +14,7 @@ InputAdornment, IconButton, } from '@mui/material'; -import { updateUserInfo } from '@/api/auth'; +import { requestResetPassword } from '@/api/auth'; import Visibility from '@mui/icons-material/Visibility'; import VisibilityOff from '@mui/icons-material/VisibilityOff'; @@ -39,22 +39,19 @@ }, [userInfo, setValue]) const onSubmit = (data) => { - console.log(data); - return false; - setLoading(true); - updateUserInfo({ id: userInfo.id, ...data }).then(res => { + requestResetPassword(data).then(res => { setLoading(false); const { code, msg, data } = res; if (code === 200) { notify(msg, { type: 'success', messageArgs: { _: msg } }); reset(); + } else if (code === 408) { + setError('oldPassword', { + message: msg, + }); } else { notify(msg, { type: 'error', messageArgs: { _: msg } }); - setError('oldPassword', { - type: 'server', // make no sense - message: res.msg, - }); } }).catch((error) => { setLoading(false); -- Gitblit v1.9.1