From 2a4e3514ef2b0974b83a430ddc0e8a03b0591812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E9=B8=9F=E7=94=9F=E4=BA=A7?= Date: Wed, 18 Mar 2026 13:38:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/VERSION | 2 +- frontend/src/pages/Settings.jsx | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/VERSION b/config/VERSION index 8cb3856..e1d7bef 100644 --- a/config/VERSION +++ b/config/VERSION @@ -2,7 +2,7 @@ # Version Configuration for Zodiac Collection Management System # 当前版本号 (语义化版本:主版本。次版本.修订版) -VERSION=1.1.3 +VERSION=1.1.4 # 版本代号 (可选) VERSION_CODENAME="新生" diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx index a19dcd9..0dca1f3 100644 --- a/frontend/src/pages/Settings.jsx +++ b/frontend/src/pages/Settings.jsx @@ -110,6 +110,11 @@ export default function Settings() { setError('') setSuccess('') + if (!passwordForm.oldPassword) { + setError('请输入当前密码') + return + } + if (passwordForm.newPassword !== passwordForm.confirmPassword) { setError('两次输入的密码不一致') return @@ -121,8 +126,10 @@ export default function Settings() { } setSaving(true) + console.log('开始修改密码...') try { + console.log('发送请求到 /api/auth/change-password') const res = await fetch('/api/auth/change-password', { method: 'POST', headers: { @@ -135,12 +142,16 @@ export default function Settings() { }) }) + console.log('响应状态:', res.status) + const data = await res.json() + console.log('响应数据:', data) + if (res.ok) { setSuccess('密码修改成功!') setPasswordForm({ oldPassword: '', newPassword: '', confirmPassword: '' }) } else { - const data = await res.json() - setError(data.error?.message || '密码修改失败') + setError(data.error?.message || data.detail || '密码修改失败') + } } } catch (e) { setError('密码修改失败,请重试')