feat: add password change functionality

- Add password change button to sidebar account menu
- Create PasswordChangeDialog component with shadcn UI components
- Implement backend API endpoint /api/v1/user/change-password
- Add form validation with current password verification
- Include internationalization support for Chinese and English
- Add proper error handling and success notifications

Co-Authored-By: Rock <rockchinq@gmail.com>
This commit is contained in:
Devin AI
2025-08-17 03:03:36 +00:00
parent 29f0075bd8
commit dd30d08c68
7 changed files with 257 additions and 0 deletions

View File

@@ -44,6 +44,20 @@ const enUS = {
forgotPassword: 'Forgot Password?',
loading: 'Loading...',
theme: 'Theme',
changePassword: 'Change Password',
currentPassword: 'Current Password',
newPassword: 'New Password',
confirmNewPassword: 'Confirm New Password',
enterCurrentPassword: 'Enter current password',
enterNewPassword: 'Enter new password',
enterConfirmPassword: 'Confirm new password',
currentPasswordRequired: 'Current password is required',
newPasswordRequired: 'New password is required',
confirmPasswordRequired: 'Confirm password is required',
passwordsDoNotMatch: 'Passwords do not match',
changePasswordSuccess: 'Password changed successfully',
changePasswordFailed: 'Failed to change password',
currentPasswordIncorrect: 'Current password is incorrect',
},
notFound: {
title: 'Page not found',

View File

@@ -44,6 +44,20 @@ const zhHans = {
forgotPassword: '忘记密码?',
loading: '加载中...',
theme: '主题',
changePassword: '修改密码',
currentPassword: '当前密码',
newPassword: '新密码',
confirmNewPassword: '确认新密码',
enterCurrentPassword: '输入当前密码',
enterNewPassword: '输入新密码',
enterConfirmPassword: '确认新密码',
currentPasswordRequired: '当前密码不能为空',
newPasswordRequired: '新密码不能为空',
confirmPasswordRequired: '确认密码不能为空',
passwordsDoNotMatch: '两次输入的密码不一致',
changePasswordSuccess: '密码修改成功',
changePasswordFailed: '密码修改失败',
currentPasswordIncorrect: '当前密码不正确',
},
notFound: {
title: '页面不存在',