diff --git a/frontend/src/components/user/ProfilePage.tsx b/frontend/src/components/user/ProfilePage.tsx
index 125c7dc..ab1c95e 100644
--- a/frontend/src/components/user/ProfilePage.tsx
+++ b/frontend/src/components/user/ProfilePage.tsx
@@ -55,11 +55,19 @@ export default function ProfilePage() {
const username = profile?.username || storeUser?.username || '';
const handleChangePassword = async () => {
- if (!oldPwd || newPwd.length < 6) return;
+ // 显式校验并给出提示,避免"点了没反应"。// Logan.Li
+ if (!oldPwd) {
+ toast({ title: '请先输入当前密码', variant: 'destructive' });
+ return;
+ }
+ if (newPwd.length < 6) {
+ toast({ title: '新密码至少 6 位', variant: 'destructive' });
+ return;
+ }
setPwdSaving(true);
try {
await authApi.changePassword({ old_password: oldPwd, new_password: newPwd });
- toast({ title: '密码已修改' });
+ toast({ title: '密码已修改', description: '下次登录请使用新密码' });
setOldPwd('');
setNewPwd('');
} catch (e: unknown) {
@@ -121,7 +129,7 @@ export default function ProfilePage() {
setNewPwd(e.target.value)} className="mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]" />
-