import {http2} from "@/utils/request.js";
/* -------------------------------------------------------------- */
/**管理员权限管理 */
/**-------------------------------------------------------- */
/**路由权限管理 */

/**获取权限列表 */
export const getPermissionList = (params) => {
  return http2.get('/api/v1/admin/server/permission/path/list', {params: params})
}
/**新增权限信息 */
export const addPermissionInfo = (data) => {
  return http2.post('/api/v1/admin/server/permission/path/add', data,{
    headers:{
      'Content-Type':'multipart/form-data'
    }
  })
}
/**修改权限信息 */
export const updatePermissionInfo = (data) => {
  return http2.post('/api/v1/admin/server/permission/path/update', data,{
    headers:{
      'Content-Type':'multipart/form-data'
    }
  })
}
/**删除权限信息 */
export const deletePermissionInfo = (data) => {
  return http2.delete('/api/v1/admin/server/permission/path/delete', {
    data: data,
    headers:{
      'Content-Type':'multipart/form-data'
    }
  })
}

/**-------------------------------------------------------- */
/**管理员权限分配 */

/**获取指定管理员的权限列表 */
export const getPermissionListByAdmin = (params) => {
  return http2.get('/api/v1/admin/server/permission/admin/list', {params: params})
}
/**新增管理员权限 */
export const addPermissionAdmin = (data) => {
  return http2.post('/api/v1/admin/server/permission/admin/add', data,{
    headers:{
      'Content-Type':'multipart/form-data'
    }
  })
}
/**修改管理员权限 */
export const updatePermissionAdmin = (data) => {
  return http2.post('/api/v1/admin/server/permission/admin/update', data,{
    headers:{
      'Content-Type':'multipart/form-data'
    }
  })
}
/**删除管理员权限 */
export const deletePermissionAdmin = (data) => {
  return http2.delete('/api/v1/admin/server/permission/admin/delete', {
    data: data,
    headers:{
      'Content-Type':'multipart/form-data'
    }
  })
}

