feat: 整体pure,核心功能对接完成

This commit is contained in:
橙子
2024-09-05 23:10:40 +08:00
parent 4ed44a2a8f
commit 3339e30014
31 changed files with 459 additions and 535 deletions

View File

@@ -42,7 +42,7 @@ export const addUser = (data: any) => {
/** 查询用户个人信息 */
export const getUserProfile = () => {
return http.request<Result>("get", `/account`, {});
return http.request<UserInfoResult>("get", `/account`, {});
};
/** 修改用户个人信息 */
@@ -63,3 +63,29 @@ export const updateUserPwd = (oldPassword, newPassword) => {
};
return http.request<Result>("put", `/account/password`, { data });
};
export type UserInfoResult = {
status: number;
data: UserInfo;
};
export type UserInfo = {
user: {
/** 头像 */
icon: string;
/** 用户名 */
userName: string;
/** 昵称 */
nick: string;
/** 邮箱 */
email: string;
/** 联系电话 */
phone: string;
/** 简介 */
introduction: string;
};
/** 当前登录用户的角色 */
roleCodes: Array<string>;
/** 按钮级别权限 */
permissions: Array<string>;
};