From 85c707f62b77cecea7842ad8eeafae05e839225a Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Tue, 3 Sep 2024 10:47:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2(=E6=9C=AA=E5=AE=8C=E6=88=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/system/profile/index.ts | 35 +++++++ .../src/api/system/profile/model.d.ts | 64 ++++++++++++ .../src/views/_core/profile/index.vue | 98 ++++++++++++++++--- 3 files changed, 182 insertions(+), 15 deletions(-) create mode 100644 apps/web-antd/src/api/system/profile/index.ts create mode 100644 apps/web-antd/src/api/system/profile/model.d.ts diff --git a/apps/web-antd/src/api/system/profile/index.ts b/apps/web-antd/src/api/system/profile/index.ts new file mode 100644 index 00000000..c1ccc94b --- /dev/null +++ b/apps/web-antd/src/api/system/profile/index.ts @@ -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(Api.root); +} + +/** + * 更新用户个人主页信息 + * @param data + * @returns void + */ +export function userProfileUpdate(data: any) { + return requestClient.putWithMsg(Api.root, data); +} + +/** + * 用户修改密码 (需要加密) + * @param data + * @returns void + */ +export function userUpdatePassword(data: any) { + return requestClient.put(Api.updatePassword, data, { encrypt: true }); +} diff --git a/apps/web-antd/src/api/system/profile/model.d.ts b/apps/web-antd/src/api/system/profile/model.d.ts new file mode 100644 index 00000000..28079bbe --- /dev/null +++ b/apps/web-antd/src/api/system/profile/model.d.ts @@ -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; +} diff --git a/apps/web-antd/src/views/_core/profile/index.vue b/apps/web-antd/src/views/_core/profile/index.vue index 34f2a627..ce443624 100644 --- a/apps/web-antd/src/views/_core/profile/index.vue +++ b/apps/web-antd/src/views/_core/profile/index.vue @@ -1,36 +1,104 @@