import request from '@/utils/request'

// 查询角色列表
export function listDocument(params) {
  return request({
    url: '/system/document/list',
    method: 'get',
    params
  })
}

// 根据角色ID查询部门树结构
export function catefoyTreeSelect(parentId) {
  return request({
    url: '/system/category/getCategoryTree/' + parentId,
    method: 'get'
  })
}
// 保存分类 http://localhost:8080/system/category/add
export function saveCategory(params) {
  return request({
    url: '/system/category/add',
    method: 'post',
    data:params
  })
}
export function delCategory(ids) {
  return request({
    url: '/system/category/'+ids,
    method: 'delete',
    data: ids
  })
}

export function delDocument(ids) {
  return request({
    url: '/system/document/'+ids,
    method: 'delete',
    data: ids
  })
}
export function uploadFileHttp(data) {
  return request({
    url: '/common/uploads',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' }, //多文件上传这一句必须加
    data
  })
}
export function saveDocument(data) {
  return request({
    url: '/system/document',
    method: 'post',
    data:data
  })
}
export function resourceDownload(params) {
  return request({
    url: '/common/download/resource?resource='+params,
    method: 'get',
    responseType: 'blob',
    timeout: 50000
  })
}
export function getBaseApi(path) {
  return request({
    url: '/common/getBase64?path='+path,
    method: 'get',
    timeout: 50000
  })
}

