feat: 完善系统管理-用户管理页面 (#688)

* feat: 完善系统管理-用户管理页面

* feat: 上传头像

* feat: 重置密码

* feat: 分配角色

* chore: update type

* chore: done
This commit is contained in:
xiaoming
2023-08-29 11:18:00 +08:00
committed by GitHub
parent fad5483491
commit bc1bd23e80
20 changed files with 1978 additions and 1214 deletions

View File

@@ -1,6 +1,11 @@
import { http } from "@/utils/http";
type Result = {
success: boolean;
data?: Array<any>;
};
type ResultTable = {
success: boolean;
data?: {
/** 列表数据 */
@@ -14,22 +19,27 @@ type Result = {
};
};
type ResultDept = {
success: boolean;
data?: Array<any>;
};
/** 获取用户管理列表 */
export const getUserList = (data?: object) => {
return http.request<Result>("post", "/user", { data });
return http.request<ResultTable>("post", "/user", { data });
};
/** 用户管理-获取所有角色列表 */
export const getAllRoleList = () => {
return http.request<Result>("get", "/list-all-role");
};
/** 用户管理-根据userId获取对应角色id列表userId用户id */
export const getRoleIds = (data?: object) => {
return http.request<Result>("post", "/list-role-ids", { data });
};
/** 获取角色管理列表 */
export const getRoleList = (data?: object) => {
return http.request<Result>("post", "/role", { data });
return http.request<ResultTable>("post", "/role", { data });
};
/** 获取部门管理列表 */
export const getDeptList = (data?: object) => {
return http.request<ResultDept>("post", "/dept", { data });
return http.request<Result>("post", "/dept", { data });
};