import { getToken } from "@/utils/auth"
import request from '@/utils/request'

export function upUrl() {
  return process.env.VUE_APP_BASE_API + '/file/'
}

export function upHeaders() {
  return { Authorization: "Bearer " + getToken() }
}

export function getFileList(query) {
  return request({
    url: '/file/',
    method: 'get',
    params: query
  })
}

export function deleteFile(id) {
  return request({
    url: '/file/' + id + '/',
    method: 'delete'
  })
}

export function clearFiles() {
  return request({
    url: '/file/clear_all/',
    method: 'delete'
  })
}

export function replaceUrl(data) {
  return request({
    url: '/file/replace_url/',
    method: 'post',
    data
  })
}

