From 400b7272d4e181cf0c1b8c25455dba26cd6c0ac2 Mon Sep 17 00:00:00 2001 From: zhangjf Date: Mon, 23 Feb 2026 12:32:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增修改密码页面 (my/ChangePassword.vue) - 支持输入旧密码、新密码、确认密码 - 密码验证:至少6位、两次输入一致性校验 - 修改成功后自动清除登录信息并跳转到登录页 2. 新增API接口 (updatePassword) - PUT /sys/profile/password - 参数: oldPassword, newPassword, confirmPassword 3. 更新路由配置 - 新增 /my/change-password 路由 4. 更新我的页面 - 修改密码点击跳转到修改密码页面 --- fund-mobile/src/api/index.ts | 4 + fund-mobile/src/router/index.ts | 6 + fund-mobile/src/views/my/ChangePassword.vue | 145 ++++++++++++++++++++ fund-mobile/src/views/my/Index.vue | 2 +- 4 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 fund-mobile/src/views/my/ChangePassword.vue diff --git a/fund-mobile/src/api/index.ts b/fund-mobile/src/api/index.ts index 8e591bf..a8fc613 100644 --- a/fund-mobile/src/api/index.ts +++ b/fund-mobile/src/api/index.ts @@ -14,6 +14,10 @@ export function logout() { return request.post('/auth/logout') } +export function updatePassword(data: { oldPassword: string; newPassword: string; confirmPassword: string }) { + return request.put('/sys/profile/password', data) +} + // ===================== 项目管理 ===================== export function getProjectList(params?: { pageNum: number; pageSize: number; keyword?: string }) { diff --git a/fund-mobile/src/router/index.ts b/fund-mobile/src/router/index.ts index fa72a96..722d987 100644 --- a/fund-mobile/src/router/index.ts +++ b/fund-mobile/src/router/index.ts @@ -82,6 +82,12 @@ const router = createRouter({ component: () => import('@/views/my/Index.vue'), meta: { title: '我的', requiresAuth: true } }, + { + path: '/my/change-password', + name: 'ChangePassword', + component: () => import('@/views/my/ChangePassword.vue'), + meta: { title: '修改密码', requiresAuth: true } + }, // 登录 { path: '/login', diff --git a/fund-mobile/src/views/my/ChangePassword.vue b/fund-mobile/src/views/my/ChangePassword.vue new file mode 100644 index 0000000..1a522c6 --- /dev/null +++ b/fund-mobile/src/views/my/ChangePassword.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/fund-mobile/src/views/my/Index.vue b/fund-mobile/src/views/my/Index.vue index 0d2691f..8aab5a9 100644 --- a/fund-mobile/src/views/my/Index.vue +++ b/fund-mobile/src/views/my/Index.vue @@ -55,7 +55,7 @@ const userInfo = ref({ }) const handleChangePassword = () => { - showToast('功能开发中') + router.push('/my/change-password') } const handleAbout = () => {