feat: 个人中心页面(未完成)

This commit is contained in:
dap
2024-09-03 10:47:33 +08:00
parent 560a82f089
commit 85c707f62b
3 changed files with 182 additions and 15 deletions

View File

@@ -0,0 +1,35 @@
import type { UserProfile } from './model';
import { requestClient } from '#/api/request';
enum Api {
root = '/system/user/profile',
updateAvatar = '/system/user/profile/avatar',
updatePassword = '/system/user/profile/updatePwd',
}
/**
* 用户个人主页信息
* @returns userInformation
*/
export function userProfile() {
return requestClient.get<UserProfile>(Api.root);
}
/**
* 更新用户个人主页信息
* @param data
* @returns void
*/
export function userProfileUpdate(data: any) {
return requestClient.putWithMsg<void>(Api.root, data);
}
/**
* 用户修改密码 (需要加密)
* @param data
* @returns void
*/
export function userUpdatePassword(data: any) {
return requestClient.put<void>(Api.updatePassword, data, { encrypt: true });
}

View File

@@ -0,0 +1,64 @@
export interface Dept {
deptId: number;
parentId: number;
parentName?: any;
ancestors: string;
deptName: string;
orderNum: number;
leader: string;
phone?: any;
email: string;
status: string;
createTime?: any;
}
export interface Role {
roleId: number;
roleName: string;
roleKey: string;
roleSort: number;
dataScope: string;
menuCheckStrictly?: any;
deptCheckStrictly?: any;
status: string;
remark: string;
createTime?: any;
flag: boolean;
superAdmin: boolean;
}
export interface User {
userId: number;
tenantId: string;
deptId: number;
userName: string;
nickName: string;
userType: string;
email: string;
phonenumber: string;
sex: string;
avatar: string;
status: string;
loginIp: string;
loginDate: string;
remark: string;
createTime: string;
dept: Dept;
roles: Role[];
roleIds?: string[];
postIds?: string[];
roleId: number;
deptName: string;
}
/**
* @description 用户个人主页信息
* @param user 用户信息
* @param roleGroup 角色名称
* @param postGroup 岗位名称
*/
export interface UserProfile {
user: User;
roleGroup: string;
postGroup: string;
}