feat:新增个人中心api

This commit is contained in:
chenchun
2024-09-05 21:44:10 +08:00
parent 6134e76030
commit 4ed44a2a8f
2 changed files with 27 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { http } from "@/utils/http";
import type { Result, ResultList, ResultPage } from "@/api/result";
import type { Result, ResultPage } from "@/api/result";
/** 获取系统管理-用户管理列表 */
export const getUserList = (data?: object) => {
@@ -39,3 +39,27 @@ export const updateUser = (id: string, data: any) => {
export const addUser = (data: any) => {
return http.request<Result>("post", `/user`, { data });
};
/** 查询用户个人信息 */
export const getUserProfile = () => {
return http.request<Result>("get", `/account`, {});
};
/** 修改用户个人信息 */
export const updateUserProfile = data => {
return http.request<Result>("put", `/user/profile`, { data });
};
/** 只修改用户头像 */
export const updateUserIcon = data => {
return http.request<Result>("put", `/account/icon`, { data: { icon: data } });
};
/** 用户密码重置 */
export const updateUserPwd = (oldPassword, newPassword) => {
const data = {
oldPassword,
newPassword
};
return http.request<Result>("put", `/account/password`, { data });
};