Vben
authored
|
1
2
3
|
import {
AccountParams,
DeptListItem,
|
Vben
authored
|
4
5
|
MenuParams,
RoleParams,
|
Vben
authored
|
6
|
RolePageParams,
|
Vben
authored
|
7
|
MenuListGetResultModel,
|
Vben
authored
|
8
9
|
DeptListGetResultModel,
AccountListGetResultModel,
|
Vben
authored
|
10
|
RolePageListGetResultModel,
|
Vben
authored
|
11
|
RoleListGetResultModel,
|
Vben
authored
|
12
|
} from './model/systemModel';
|
Vben
authored
|
13
14
15
|
import { defHttp } from '/@/utils/http/axios';
enum Api {
|
sanmu
authored
|
16
|
AccountList = '/order/erp/users/list_by_page',
|
|
17
|
IsAccountExist = '/system/accountExist',
|
Vben
authored
|
18
|
DeptList = '/system/getDeptList',
|
|
19
|
setRoleStatus = '/system/setRoleStatus',
|
Vben
authored
|
20
|
MenuList = '/system/getMenuList',
|
sanmu
authored
|
21
|
RolePageList = '/order/erp/roles/list_by_page',
|
Vben
authored
|
22
|
GetAllRoleList = '/system/getAllRoleList',
|
Vben
authored
|
23
24
|
}
|
sanmu
authored
|
25
26
27
28
29
30
|
export const getAccountList = async (params: AccountParams) => {
const res = await defHttp.post<AccountListGetResultModel>({ url: Api.AccountList, params });
return new Promise((resolve) => {
resolve(res.records);
});
};
|
Vben
authored
|
31
32
33
|
export const getDeptList = (params?: DeptListItem) =>
defHttp.get<DeptListGetResultModel>({ url: Api.DeptList, params });
|
Vben
authored
|
34
35
36
37
|
export const getMenuList = (params?: MenuParams) =>
defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params });
|
sanmu
authored
|
38
39
40
41
42
43
|
export const getRoleListByPage = async (params?: RolePageParams) => {
const res = await defHttp.post<RolePageListGetResultModel>({ url: Api.RolePageList, params });
return new Promise((resolve) => {
resolve(res.records);
});
};
|
Vben
authored
|
44
45
46
|
export const getAllRoleList = (params?: RoleParams) =>
defHttp.get<RoleListGetResultModel>({ url: Api.GetAllRoleList, params });
|
|
47
48
49
|
export const setRoleStatus = (id: number, status: string) =>
defHttp.post({ url: Api.setRoleStatus, params: { id, status } });
|
|
50
51
52
|
export const isAccountExist = (account: string) =>
defHttp.post({ url: Api.IsAccountExist, params: { account } }, { errorMessageMode: 'none' });
|