vue-vben-admin/src/api/demo/system.ts

45 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-03-01 22:54:21 +08:00
import {
AccountParams,
DeptListItem,
2021-03-03 22:52:25 +08:00
MenuParams,
RoleParams,
RolePageParams,
2021-03-03 22:52:25 +08:00
MenuListGetResultModel,
2021-03-01 22:54:21 +08:00
DeptListGetResultModel,
AccountListGetResultModel,
RolePageListGetResultModel,
2021-03-03 22:52:25 +08:00
RoleListGetResultModel,
2021-03-01 22:54:21 +08:00
} from './model/systemModel';
2021-03-01 00:56:25 +08:00
import { defHttp } from '/@/utils/http/axios';
enum Api {
AccountList = '/system/getAccountList',
IsAccountExist = '/system/accountExist',
2021-03-01 22:54:21 +08:00
DeptList = '/system/getDeptList',
setRoleStatus = '/system/setRoleStatus',
2021-03-03 22:52:25 +08:00
MenuList = '/system/getMenuList',
RolePageList = '/system/getRoleListByPage',
GetAllRoleList = '/system/getAllRoleList',
2021-03-01 00:56:25 +08:00
}
2021-03-01 22:54:21 +08:00
export const getAccountList = (params: AccountParams) =>
defHttp.get<AccountListGetResultModel>({ url: Api.AccountList, params });
export const getDeptList = (params?: DeptListItem) =>
defHttp.get<DeptListGetResultModel>({ url: Api.DeptList, params });
2021-03-03 22:52:25 +08:00
export const getMenuList = (params?: MenuParams) =>
defHttp.get<MenuListGetResultModel>({ url: Api.MenuList, params });
export const getRoleListByPage = (params?: RolePageParams) =>
defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params });
export const getAllRoleList = (params?: RoleParams) =>
defHttp.get<RoleListGetResultModel>({ url: Api.GetAllRoleList, params });
export const setRoleStatus = (id: number, status: string) =>
defHttp.post({ url: Api.setRoleStatus, params: { id, status } });
export const isAccountExist = (account: string) =>
defHttp.post({ url: Api.IsAccountExist, params: { account } }, { errorMessageMode: 'none' });