feat: 个人信息页和修改密码页支持深色模式,添加独立修改密码功能

- 个人信息页和修改密码页适配 Vben 深色模式
- 头像下拉菜单新增修改密码入口,跳转 /system/change-password
- 新增独立修改密码页面(/system/change-password)
- 新增 changePasswordApi 调用后端 /user/change-password 接口
- 新增路由文件和相关 locale
This commit is contained in:
小蟑螂
2026-04-20 01:30:37 +08:00
parent 5e8864b355
commit 2b23e46d87
7 changed files with 231 additions and 10 deletions
@@ -3,6 +3,11 @@ import { useAccessStore } from '@vben/stores';
import { baseRequestClient, requestClient } from '#/api/request';
export namespace AuthApi {
/** 修改密码参数 */
export interface ChangePasswordParams {
oldPassword: string;
newPassword: string;
}
/** 登录接口参数 */
export interface LoginParams {
account: string;
@@ -112,3 +117,10 @@ export async function getAccessCodesApi() {
export async function switchAccountApi(userId: number) {
return requestClient.post<AuthApi.LoginResult>(`/auth/switch/${userId}`);
}
/**
* 修改密码
*/
export async function changePasswordApi(data: AuthApi.ChangePasswordParams) {
return requestClient.post('/user/change-password', data);
}