import axios from 'axios'; export interface AuthCreateRecord { name: string; // dataScope: string; // permissionIds: (number | undefined)[]; remark: string; enabled: boolean; // authorities: (number | undefined)[]; } // 基础信息 export interface AuthRecord extends AuthCreateRecord { id: string; } // export interface RoleListRecord extends AuthRecord { // name: string; // } // 查询所有的权限列表 export function queryAuthList(data: any) { return axios({ url: '/api/rest/auth', // 路径 method: 'get', params: data, // 参数 }); } // 切换启用状态 export function enabled(id: string) { return axios.patch(`/api/rest/auth/toggle/${id}`); } // 删除 export function remove(id: string) { return axios.delete(`/api/rest/auth/${id}`); } // 添加 export function create(data: AuthCreateRecord) { return axios.post(`/api/rest/auth`, data); } // 更新 export function update(data: AuthRecord) { return axios.patch(`/api/rest/auth/${data.id}`, data); } // 获取详情 export function getDetail(id: string) { return axios.get(`/api/rest/auth/${id}`); } // export function queryRoles(params?: ListParams>) { // return queryList(`/api/rest/role/query`, params); // }