Blame view

src/api/demo/system.ts 1.5 KB
Vben authored
1
2
3
import {
  AccountParams,
  DeptListItem,
4
5
  MenuParams,
  RoleParams,
6
  RolePageParams,
7
  MenuListGetResultModel,
Vben authored
8
9
  DeptListGetResultModel,
  AccountListGetResultModel,
10
  RolePageListGetResultModel,
11
  RoleListGetResultModel,
Vben authored
12
} from './model/systemModel';
13
14
15
16
import { defHttp } from '/@/utils/http/axios';

enum Api {
  AccountList = '/system/getAccountList',
17
  IsAccountExist = '/system/accountExist',
Vben authored
18
  DeptList = '/system/getDeptList',
19
  setRoleStatus = '/system/setRoleStatus',
20
  MenuList = '/system/getMenuList',
21
22
  RolePageList = '/system/getRoleListByPage',
  GetAllRoleList = '/system/getAllRoleList',
23
24
}
Vben authored
25
26
27
28
29
export const getAccountList = (params: AccountParams) =>
  defHttp.get<AccountListGetResultModel>({ url: Api.AccountList, params });

export const getDeptList = (params?: DeptListItem) =>
  defHttp.get<DeptListGetResultModel>({ url: Api.DeptList, params });
30
31
32
33

export const getMenuList = (params?: MenuParams) =>
  defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params });
34
35
36
37
38
export const getRoleListByPage = (params?: RolePageParams) =>
  defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params });

export const getAllRoleList = (params?: RoleParams) =>
  defHttp.get<RoleListGetResultModel>({ url: Api.GetAllRoleList, params });
39
40
41

export const setRoleStatus = (id: number, status: string) =>
  defHttp.post({ url: Api.setRoleStatus, params: { id, status } });
42
43
44

export const isAccountExist = (account: string) =>
  defHttp.post({ url: Api.IsAccountExist, params: { account } }, { errorMessageMode: 'none' });